Skip to Content
0
Former Member
Nov 07, 2005 at 05:14 PM

XSL mapping of ARTMAS IDoc - carriage returns and white space

116 Views

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:

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