cancel
Showing results for 
Search instead for 
Did you mean: 

Getting Values from Nested structured XML using Java Mapping

Former Member
0 Kudos

Hi Experts,

I have a source XML structure where the part of it is like below-

   E1EDS21        1..Unbounded

      ELDTP         1

      LIHGD          1

      ZE1EDS33    1...Unbounded

          UPST       1

          GENDW   1

          EQUTD     1

Now For an Example -

        

E1EDS21 is coming 3 times and each of this containing ZE1EDS33 segments 2 , 3 and 2 times.

Can any body please help me out how to get the values from the fields by iteration.

My requirement is to concatenate all the values after the end of the iteration and produce a flat structure as below ---

    E1EDS21   12   33

    ZE1EDS33  87  99  12

    ZE1EDS33  87  99  12

    E1EDS21   12   33

    ZE1EDS33  87  99  12

    ZE1EDS33  87  99  12

    ZE1EDS33  87  99  12

    E1EDS21   12   33

    ZE1EDS33  87  99  12

    ZE1EDS33  87  99  12

             

   

I am getting problem while reading the node for each E1EDS21 , it is returning all the  ZE1EDS33 present in the document.

Request you to please help me with the code.

Thanks in advance!

Vinny,       

Accepted Solutions (0)

Answers (2)

Answers (2)

rajasekhar_reddy14
Active Contributor
0 Kudos

If you want to concat multiple iteration try below UDF.

Post your sample source xml and expectd output.

Former Member
0 Kudos

Hi Raja Sekhar and Anupam,

Thanks for looking into this, I have attached the input XML and the expected output XML.

I have also attached the java code that I have written so far.

You will find the segment name are not matching with the question I have posted initially, that was to make simple segments.

Please have a look in the files and help me out with this.

Thanks Vinny

Former Member
0 Kudos

for reference I am attaching the Sources XSD as well.

anupam_ghosh2
Active Contributor
0 Kudos

Hi Vineet,

               Please post a sample XML input and exact sample output XML you expect out of java mapping. Also kindly mention the version of PI server you are working with.

Regards

Anupam

Former Member
0 Kudos

Hi Anupam,

Thanks a lot for quick look! I am using PI 7.3  and I can not use the IDoc to FlatFile XML conversion module as this is applicable for IDoc-XML. In my case it is a IDoc structure like custom Message Type.

I have thought one last and worst option :- to create the Custom IDoc in ECC of this structure and then use the Module.

Thanks

Vinny