cancel
Showing results for 
Search instead for 
Did you mean: 

XI XML File adapter,

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

udo_martens
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Thanks for the suggestion, is there a tools to make the XSLT, my mapping is from an HRMD_A07 IDOC so the source is quite complex?

udo_martens
Active Contributor
0 Kudos

Hi Gregorio,

best would be XML Spy (Altova), but it s not freeware.

For free there is f.e. xmlNotepad, but not very comfortable.

Regards,

Udo

former_member183906
Active Contributor
Former Member
0 Kudos

As I know already which fields in the IDOC I need for every field in my target, maybe it would be easier to do it by hand, here is an example of target file:

<?xml version="1.0" encoding="iso-8859-1" ?>
<EPERSON filename="contextperson_000002.xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ContextPersonMessage">
    <CONTEXTPERSON>
        <PERSON action="update">
            <TITLE>M</TITLE> 
            <FIRSTNAME>John</FIRSTNAME> 
            <NAME>Smith</NAME> 
            <BIRTHDATE>06.02.1973</BIRTHDATE>
            <ADDRESS1>rue du stade</ADDRESS1>
            <ADDRESS2>c/o Jean-pierre</ADDRESS2>
            <POSTALCODE>CH-1234</POSTALCODE>
            <CITY>Geneve</CITY>
            <COUNTRYID>CH</COUNTRYID>
            <CATEGORY>Standard</CATEGORY>
            <CREATIONDATE>01.01.2000 09:00:00</CREATIONDATE>
        </PERSON>
        <MISCFIELD>
            <MISCFIELDTYPE>PERSN</MISCFIELDTYPE>
            <MISCFIELDVALUE>01000123</MISCFIELDVALUE>
        </MISCFIELD>
        <CONTACT>
            <CONTACTTYPE>E-mail</CONTACTTYPE>
            <CONTACTVALUE>john.smith_AT_example.com</CONTACTVALUE>
        </CONTACT>
    </CONTEXTPERSON>
</EPERSON>

I have to create a CONTEXTPERSON for every E1PLOGI that is in the HRMD_A07 IDOC.

Any tip for starting ? like how to get the HRMD_A07->E1PLOGI->E1PITYP->E1P0002-NACHN for the Name field ? The rest would be most like that one

udo_martens
Active Contributor
0 Kudos

Hi Gregorio,

you need to learn a bit XSL. It is very easy, if you are concentrated, just in 2 days. I think you looking for xsl:for-each...

Regards,

Udo

Answers (0)