cancel
Showing results for 
Search instead for 
Did you mean: 

PI 7.0: recursive structure can not be mapping to a flat structure

Former Member
0 Kudos

I use PI 7.0 ,the source structure is like this:

<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">

<wsdl:types>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

...

<xsd:complexType xmlns:p0="http://www.w3.org/XML/1998/namespace" name="NodeA">

<xsd:element name="NodeA" type="NodeA" minOccurs="0" maxOccurs="unbounded" />

<xsd:attribute name="ID" type="xsd:string" />

<xsd:attribute name="NAME" type="xsd:string" />

</xsd:complexType>

</wsdl:types>

<wsdl:message name="root">

<wsdl:part name="root" element="root" />

</wsdl:message>

</wsdl:definitions>

"NodeA" is recursive type.

I want to transform the source data to flat file.

examples:

source xml(tree):

101 AAA

__201 BBB

_______301 CCC

_______302 DDD

_____________401 EEE

destination (flat file):

ID NAME FID

101 AAA

201 BBB 101

301 CCC 201

302 DDD 201

401 EEE 302

Because NodeA is recursive, I can not make the mapping work.

can Anyone help me?

Thanks!

Edited by: Harry on Feb 26, 2009 8:50 AM

Edited by: Harry on Feb 26, 2009 8:51 AM

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

I solved this using XSL. like this:

<xsl:for-each select="SELF">

<N1>

<xsl:attribute name="ID"> <xsl:value-of select="@id"/> </xsl:attribute>

<xsl:attribute name="NAME"> <xsl:value-of select="@name"/> </xsl:attribute>

<xsl:attribute name="DES"> <xsl:value-of select="@des"/> </xsl:attribute>

</N1>

</xsl:for-each>

former_member181985
Active Contributor
0 Kudos

You can not create flat structure in XI.

Instead you use a dummy interface( Message type) for Flat File Receiver for carrying the coverted structure from Sender File Adapter.

The Conversion is done on the File Sender Adpater level and you have to USE File content conversion concept.

Thanks,

- Gujjeti.

markangelo_dihiansan
Active Contributor
0 Kudos

Hi,

Would you be able to provide the actual source and target structure?

Regards,

Former Member
0 Kudos

This is my Message Type, you can import them as External Defination:

Then map MT_Src to MT_DEST. Thanks!

MT_Src:

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

<xsd:schema targetNamespace="http://test.com/diss" xmlns="http://test.com/diss" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><xsd:element name="MT_SRC" type="DT_SRC" /><xsd:complexType name="DT_SRC"><xsd:annotation><xsd:appinfo source="http://sap.com/xi/TextID">82c08380046b11de920c001a4b064ae2</xsd:appinfo></xsd:annotation><xsd:sequence><xsd:element name="TEST" type="DT_TEST" minOccurs="0" maxOccurs="unbounded" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><xsd:annotation><xsd:appinfo source="http://sap.com/xi/TextID">c23a4750046911decc490019210863b9</xsd:appinfo></xsd:annotation></xsd:element></xsd:sequence></xsd:complexType><xsd:complexType name="DT_TEST"><xsd:annotation><xsd:appinfo source="http://sap.com/xi/TextID">82c23130046b11de833d001a4b064ae2</xsd:appinfo></xsd:annotation><xsd:sequence><xsd:element name="SELF" type="DT_TEST" minOccurs="0" maxOccurs="unbounded" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><xsd:annotation><xsd:appinfo source="http://sap.com/xi/TextID">71c72500046811de98e60019210863b9</xsd:appinfo></xsd:annotation></xsd:element></xsd:sequence><xsd:attribute name="ID" type="xsd:string" use="required" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><xsd:annotation><xsd:appinfo source="http://sap.com/xi/TextID">4a0a4dc0046911deaff30019210863b9</xsd:appinfo></xsd:annotation></xsd:attribute><xsd:attribute name="NAME" type="xsd:string" use="required" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><xsd:annotation><xsd:appinfo source="http://sap.com/xi/TextID">4a0a4dc1046911dec5290019210863b9</xsd:appinfo></xsd:annotation></xsd:attribute><xsd:attribute name="DES" type="xsd:string"><xsd:annotation><xsd:appinfo source="http://sap.com/xi/TextID">61958680046911de964c0019210863b9</xsd:appinfo></xsd:annotation></xsd:attribute></xsd:complexType></xsd:schema>

MT_DEST:

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

<xsd:schema targetNamespace="http://test.com/diss" xmlns="http://test.com/diss" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><xsd:element name="MT_DEST" type="DT_DEST" /><xsd:complexType name="DT_DEST1"><xsd:annotation><xsd:appinfo source="http://sap.com/xi/TextID">8ead08d0046b11de9c38001a4b064ae2</xsd:appinfo></xsd:annotation><xsd:sequence><xsd:element name="ID" type="xsd:string"><xsd:annotation><xsd:appinfo source="http://sap.com/xi/TextID">0112d730046a11de9e6f0019210863b9</xsd:appinfo></xsd:annotation></xsd:element><xsd:element name="NAME" type="xsd:string"><xsd:annotation><xsd:appinfo source="http://sap.com/xi/TextID">0112d731046a11dea46d0019210863b9</xsd:appinfo></xsd:annotation></xsd:element><xsd:element name="FID" type="xsd:string"><xsd:annotation><xsd:appinfo source="http://sap.com/xi/TextID">0112d732046a11deace60019210863b9</xsd:appinfo></xsd:annotation></xsd:element></xsd:sequence></xsd:complexType><xsd:complexType name="DT_DEST"><xsd:annotation><xsd:appinfo source="http://sap.com/xi/TextID">8eab5b20046b11deba72001a4b064ae2</xsd:appinfo></xsd:annotation><xsd:sequence><xsd:element name="D1" type="DT_DEST1" minOccurs="0" maxOccurs="unbounded" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><xsd:annotation><xsd:appinfo source="http://sap.com/xi/TextID">18188c40046a11deac300019210863b9</xsd:appinfo></xsd:annotation></xsd:element></xsd:sequence></xsd:complexType></xsd:schema>