cancel
Showing results for 
Search instead for 
Did you mean: 

XSL mapping does not work anymore

peter_wallner2
Active Contributor
0 Kudos

Dear experts,

We are upgrading from XI 3.0 to PI 7.1

I had an XSL mapping which was working in XI but not in PI 7.1. In the Adapter Monitoring of my FTP receiver adapter I get the error:

Exception in XML Parser (format problem?):'org.xml.sax.SAXParseException: Content is not allowed in prolog.'

My mapping looks like this. The output is a CSV file. It creates a headline, divides the elemts with a " ; " and then maps a few fields and separates those with a " ; " and enters a line feed (
).


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
<xsl:output method="text" version="1.0" encoding="ISO-8859-1" indent="no"></xsl:output>
	
	<xsl:template match="/">
		<xsl:apply-templates select="rfc:Z_CA_CAT_CALL_XI/IT_CAT_MATCOCK"></xsl:apply-templates>
	</xsl:template>

<xsl:template match="IT_CAT_MATCOCK">
<!-- the Headline -->
<xsl:text>Werk</xsl:text><xsl:text>;</xsl:text>
<xsl:text>Material</xsl:text><xsl:text>;</xsl:text>
<xsl:text>Kurztext</xsl:text><xsl:text>;</xsl:text>
<xsl:text>Produkthierarchie</xsl:text><xsl:text>;</xsl:text>
<xsl:text>Sparte</xsl:text><xsl:text>;</xsl:text>
<xsl:text>verfügbare Menge</xsl:text><xsl:text>;</xsl:text>
<xsl:text>&#xD;</xsl:text>

	<xsl:for-each select="item">
	<!-- Sorting -->
		<xsl:sort select="SPART" data-type="number" order="ascending"></xsl:sort>
		<xsl:sort select="PRDHA" data-type="text" order="ascending"></xsl:sort>
	<!-- fields -->
		<xsl:value-of select="LAG_WERK"></xsl:value-of><xsl:text>;</xsl:text>
		<xsl:value-of select="MATNR"></xsl:value-of><xsl:text>;</xsl:text>
		<xsl:value-of select="MAKTX"></xsl:value-of><xsl:text>;</xsl:text>
		<xsl:value-of select="PRDHA"></xsl:value-of><xsl:text>;</xsl:text>
		<xsl:value-of select="SPART"></xsl:value-of><xsl:text>;</xsl:text>
		<xsl:value-of select="format-number(ATP_MNG,'0')"></xsl:value-of><xsl:text>;</xsl:text>
		<xsl:if test="not(position()=last())">
          <xsl:text>&#xD;</xsl:text>
        </xsl:if>
		
	</xsl:for-each>

</xsl:template>
	
</xsl:stylesheet>

Does anyone have an idea what format problem I could have? It also works in XML Spy perfectly just PI 7.1 does not "like" it....

Thank you very much for your help,

Peter

Accepted Solutions (0)

Answers (3)

Answers (3)

stefan_grube
Active Contributor
0 Kudos

mark "use sapxmltoolkit" in operation mapping. That should help.

Sorry, Raja has already mentioned. I did not notice.

Edited by: Stefan Grube on Mar 5, 2010 9:18 AM

peter_wallner2
Active Contributor
0 Kudos

Hello,

Thanks a lot to everyone! I found out that I used the wrong FTP-adapter as receiver. I have two, one with content conversion and one without that.

I have to use the one without content conversion because in my XSL-Mapping the content is already converted.

I did try it with XML Toolkit activated and not activated - both ways it worked. Thank you for showing me this option though - might be helpful some time in the future!

When I test the mapping though under "operation mapping" the test gives me an error saying:

(Fatal Error: com.sap.engine.lib.xml.parser.ParserException:
 XMLParser: No data allowed here: (hex) 57, 65, 72(:main:, row:1, col:3))

I assume that the test can only display XML data and I am converting to CSV in my XML mapping. That is the reason for the error.

Anyways, it works fine now, the problem was the wrong FTP receiver.

Best regards,

Peter

Shabarish_Nair
Active Contributor
0 Kudos
rajasekhar_reddy14
Active Contributor
0 Kudos

Hi,

Do you think XSLT processor not executing your XSLT Program,if yes then try to use option SAP XML Tool kit in Operation mapping,if you still facing the problem,may be you hav to change XSLT code.

i written some XSLT programs output method as text,xml,all worked perfectly,

Regards,

Raj