Five Stars

File xml -- Get Loop Index for the xpath

We are using filexml to parse a xml file.

 

We have a requirement to find the loop index, is there any xpath expression to populate the counter

Our file looks like

 

<REPORT>

      <HEADER>

                 <KEY>

      <ITEM>

                 <F1>value1<F1/>

                <F2>value2<F2/>

     <ITEM/>

     <ITEM>

              <F1>value3<F1/>

              <F2>value4<F2/>

     <ITEM/>

    <HEADER/>

    <REPORT/>

 

For the above example, my output should be

ITEM value1 value2 1(loop index counter)

ITEM value3 value4 2(loop index counter)

 

We need to know the loop index for the <ITEM/> when we are parsing in FileXML? Are there any valid xpath expression i can use to determine the counter.

 

Thanks

Srini

1 REPLY
Moderator

Re: File xml -- Get Loop Index for the xpath

Hello,

Do you want to output a xml file including multiple loop elements?

Could you please elaborate your case with an example with input and expected output values?

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.