Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

XI XML File adapter,

For now I have:

<?xml version="1.0" encoding="UTF-8"?>
<EPERSON filename="20081010142234">
<CONTEXTPERSON>
... 
</CONTEXTPERSON>
<CONTEXTPERSON>
...
</CONTEXTPERSON>
</EPERSON>

and I need (requisite for the external system):

<?xml version="1.0" encoding="UTF-8"?>
<EPERSON filename="20081010142234" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ContextPersonMessage">
<CONTEXTPERSON>
... 
</CONTEXTPERSON>
<CONTEXTPERSON>
...
</CONTEXTPERSON>
</EPERSON>

This has been done using a ExternalDefinition and importing the XSD the external application provides.

Previously I reached to have:

<?xml version="1.0" encoding="UTF-8"?>
<ns0:EPERSON filename="20081010142234" xmlns:ns0="http://www.w3.org/2001/XMLSchema-instance">
<CONTEXTPERSON>
... 
</CONTEXTPERSON>
<CONTEXTPERSON>
...
</CONTEXTPERSON>
</ns0:EPERSON>

Any suggestions ? Hard coding the "xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ContextPersonMessage"" in the mapping would also be ok for me if you have any advise in that direction.

cheers,

greg

replied

Hi Gregorio,

very easy would be a XSL mapping. You just type in the static part and add the dynamic attribut filename:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:template match="/">
		<EPERSON xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ContextPersonMessage">
			<xsl:attribute name="filename"><xsl:value-of select="//EPERSON/@filename"/></xsl:attribute>
		</EPERSON>
	</xsl:template>
</xsl:stylesheet>

Regards,

Udo

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question