cancel
Showing results for 
Search instead for 
Did you mean: 

Handling repeating elements on the same hierarchical level

Former Member
0 Kudos

Hello,

I am working on the mapping that transforms SAP DESADV IDoc to the EDI DESADV format. The target format structure is here: http://www.stylusstudio.com/edifact/D00A/DESADV.htm#part4.3. In my case I need to create PAC segment from Segment Group 11, then LIN segment from Segment Group 17 and repeat, so the result structure should look like this:

PAC

LIN

PAC

LIN

The problem is that both segment groups are on the same hierarchical level. How can I say XI to create such kind of XML structure?

Currently, it can create only something like this:

<parentElement>

...

<PAC>..</PAC>

<PAC>..</PAC>

<LIN>..</LIN>

<LIN>..</LIN>

..

</parentElement>

not like:

<parentElement>

...

<PAC>..</PAC>

<LIN>..</LIN>

<PAC>..</PAC>

<LIN>..</LIN>

..

</parentElement>

I know, this is not something correct, LIN should be inside PAC element, but, since the XML is transformed to text file using SEEBURGER adapter, I guess I need to preserve this kind of structure.

Thanks in advance,

Jevgeni

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Is this not correct:

<parentElement>

...

<PAC>..</PAC>

<PAC>..</PAC>

<LIN>..</LIN>

<LIN>..</LIN>

..

</parentElement>

According to target format specification it seems that everything is all right.

Regards,

Wojciech

former_member189558
Contributor
0 Kudos

Yes..,

Your question is a little tricky to answer....

I myself am a bit confused ..

I guess the first question is as to if the parsers will support "any" order you like. Since in ur XSD .. the order is PAC first and then LIN.. ur graphical mapping will try to maintain this order.... However the problem is from another level altogether.. as to whether XML will support ur order of Pac1 and then Lin1 then Pac2 and then Lin2 so on.. or it will try to simply maintain the order in XSD.... Now the question actually boils down to the XML parsers SAX / DOM/ etc..

Here are some useful URLs for your reading..

http://www.stylusstudio.com/xmldev/200101/post10840.html

http://www-128.ibm.com/developerworks/xml/library/x-eleord.html

I guess next you can post ur specific question to the stylusstudio forum or any other XML forums..

Hope this helps....

Regards,

Himadri

former_member189558
Contributor
0 Kudos

Hello Jevgeni,

I guess u need to go for ABAP /JAVA /XSLT Mapping...

If needed you can go for 1st graphical and then a small ABAP mapping maybe...

Regards,

HImadri