cancel
Showing results for 
Search instead for 
Did you mean: 

XMl not well formed

Former Member
0 Kudos

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>

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Mendez, can you post a source document to be mapped?

Peter

Former Member
0 Kudos

here you go

<?xml version="1.0" encoding="UTF-8"?>

<ns0:BAPI_FTR_CREATEFROMDATA.Exception xmlns:ns0="urn:sap-com:document:sap:rfc:functions">

<Name/>

<Text/>

<Message>

<ID/>

<Number/>

</Message>

<Attributes>

<V1/>

<V2/>

<V3/>

<V4/>

</Attributes>

</ns0:BAPI_FTR_CREATEFROMDATA.Exception>

Former Member
0 Kudos

I think you are missing the ns0 namespace in your mapping, so you get no elements out into your target xml.

BR,

Tony.

Former Member
0 Kudos

when I put ns0 in I get the following error

Transformer configuration exception occurred when loading XSLT xslt/stylesheets/exception/exception.xsl (http://qimonda.com/TEX, 12f96f90-c8f2-11dc-a8d2-f6b124510a02, -1)

Former Member
0 Kudos

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

Former Member
0 Kudos

did you define your ns0 namespace at the beginning of the XSLT transform?

Former Member
0 Kudos

Thank you that worked... I was only adding the ns0 to the template and not the stylesheet element... Thank you!!

Answers (2)

Answers (2)

Former Member
0 Kudos

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.

VijayKonam
Active Contributor
0 Kudos

hi Mendez,

<Name><xsl:value-of select="Name"/></Name> In this line, is the / needed after "Name"? Just a guess..

VJ