AnsweredAssumed Answered

Getting correct combination of elements from xml file

Question asked by masch076107 on Jun 25, 2018
Latest reply on Jun 25, 2018 by leif_jacobsen

Hi,
I have an xml file looking like this:

 

<object>

   <objectLine>

      <objectLineNumbers>

         <tr_hist>

            <trSerial>1234</trSerial>

         </tr_hist>

         <tr_hist>

            <trSerial>2345</trSerial>

         </tr_hist>

         <tr_hist>

            <trSerial>3456</trSerial> 

         </tr_hist>

         <obNbr>5</obNbr>

         <obNbr>6</obNbr>

         <obNbr>7</obNbr>

      </objectLineNumbers>

   </objectLine>

</object>

 

I want an xml output that seperates them like this:

<object>

   <trSerial>1234</trserial>

   <obNbr>5</obNbr>

</object>

<object>

   <trSerial>2345</trserial>

   <obNbr>6</obNbr>

</object>

<object>

   <trSerial>3456</trserial>

   <obNbr>7</obNbr>

</object>

 

Does anybody now the best way to do this?
I have tried every mapping option and scripts i could think of, but i either get three objects with the same trSerial and different obNbr or nine objects with all the different combinations.

can anybody help?

Outcomes