on 11-07-2005 5:14 PM
Hi all. I have tried all sorts here and am completely stuck. I am mapping an article master ARTMAS IDoc using XSL mapping and an extra carriage return and white space characters are being added to the FIELD1 and FIELD2 fields of the E1BPE1MARAEXTRT segment and I don't know why! These fields contain all our bespoke field values joined together so they are 229 and 250 characters long respectively, which I think is related to the problem. The mapping program looks like this:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" encoding="UTF-8" omit-xml-declaration="no" indent="yes"/>
<xsl:template match="/">
<ARTMAS04>
<IDOC>
<xsl:copy-of select="//ARTMAS04/IDOC/EDI_DC40"/>
<xsl:copy-of select="//ARTMAS04/IDOC/E1BPE1MATHEAD"/>
<xsl:copy-of select="//ARTMAS04/IDOC/E1BPE1MARART"/>
<xsl:copy-of select="//ARTMAS04/IDOC/E1BPE1MARAEXTRT"/>
<xsl:copy-of select="//ARTMAS04/IDOC/E1BPE1MAKTRT"/>
<xsl:for-each select="//ARTMAS04/IDOC/E1BPE1MARCRT">
<xsl:if test="(PLANT='D100') or (PLANT='D200') or (PLANT='D300')">
<xsl:copy-of select="."/>
</xsl:if>
</xsl:for-each>
<xsl:copy-of select="//ARTMAS04/IDOC/E1BPE1MARMRT"/>
<xsl:copy-of select="//ARTMAS04/IDOC/E1BPE1MEANRT"/>
</IDOC>
</ARTMAS04>
</xsl:template>
</xsl:stylesheet>
I have a test IDoc going through this and the first 3 characters of the FIELD1 are "BIK". If I look at the source of the XML file, the problem area looks like this:
<E1BPE1MARAEXTRT SEGMENT="1">
<FUNCTION>004</FUNCTION>
<MATERIAL>000000000000895649</MATERIAL>
<b><FIELD1>
BIK</b> 0 0.00 T 000000001CARRERA FURY 04 20" CARRERA FURY 04 20" 2005092420040622 X 00000000 20031104 00200406140000000000 0.00 0000000
</FIELD1>
You can't really see it above, but there is a carriage return and 8 white spaces before the BIK. Where does this carriage return and white space come from?! Any help would be really appreciated - this is driving me crazy!
Many thanks,
Stuart Richards
Stuart,
I think I know the cause to your problem. I am not an XSLT programmer but based on searching this forum I found how I can acheive the carriage return at the end of my document. Your xsl statement is as follows:
<xsl:output method="xml" encoding="UTF-8" omit-xml-declaration="no" indent="yes"/>
Change the indent value from yes to no. This should remove the carraige return. Hope this works for you.
I actually need a carriage return and line feed on my document so I am still stuck. All I have acheived is the carraige return.
Thanks,
Jim
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Stuart
Just use the normalize-space option and your problem will be solved.
Try this,
<xsl:copy-of select="normalize-space(//ARTMAS04/IDOC/E1BPE1MARAEXTRT)"/>
cheers
Sameer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.