on 02-18-2008 3:39 PM
I have an XSLT mapping that I am trying to implement and I am doing something very simple just to confirm everything is working. However when I implement the mapping I am getting an error saying that the xml is not well formed. Could you please see the below coode and let me know why this could be:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/BAPI_FTR_CREATEFROMDATA.Exception">
<biztalk_1 xmlns="urn:biztalk-org:biztalk:biztalk_1">
<body>
<FinancialTransaction.CreateFromData.Exception>
<Name><xsl:value-of select="Name"/></Name>
</FinancialTransaction.CreateFromData.Exception>
</body>
</biztalk_1>
</xsl:template>
</xsl:stylesheet>
Hi Mendez, can you post a source document to be mapped?
Peter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Mendez, the problem is in namespace.
check this out, it works..
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="urn:sap-com:document:sap:rfc:functions">
<xsl:template match="/ns0:BAPI_FTR_CREATEFROMDATA.Exception">
<biztalk_1 xmlns="urn:biztalk-org:biztalk:biztalk_1">
<body>
<FinancialTransaction.CreateFromData.Exception>
<Name>
<xsl:value-of select="Name"/>
</Name>
</FinancialTransaction.CreateFromData.Exception>
</body>
</biztalk_1>
</xsl:template>
</xsl:stylesheet>
a, add ns0 to stylesheet element
b, use ns0 in template element (attribute match)
Peter
I could guess that either:
1) You have no <BAPI_FTR_CREATEFROMDATA.Exception> element in your source, or you have multiple <BAPI_FTR_CREATEFROMDATA.Exception> elements, and you are not allowed to have more than one of these in your target XML, since it will be the root element.
BR,
Tony.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Mendez,
<Name><xsl:value-of select="Name"/></Name> In this line, is the / needed after "Name"? Just a guess..
VJ
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.