Skip to Content
avatar image
Former Member

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Oct 10, 2008 at 01:07 PM

    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

    Add comment
    10|10000 characters needed characters exceeded