cancel
Showing results for 
Search instead for 
Did you mean: 

Getting the 2nd value of a field in 2nd occurence of parent node.

Former Member
0 Kudos

Hi,

Consider the structure

MT

.....Person(1..unbounded)

............CI(0..unbounded)

....................AT(0..unbounded)

I need to extract CI[1].AT[1]'s value.

For Ex:

<CI>

..... <AT>1<AT>

......<AT>11<AT>

</CI>

<CI>

..... <AT>2<AT>

......<AT>22<AT>

</CI>

I need only the AT having 22(can be anything) value of 2 occurence of CI. How do we do it?

Thanks in advance,

Vishal

Accepted Solutions (1)

Accepted Solutions (1)

former_member181962
Active Contributor
0 Kudos
Former Member
0 Kudos

Thanks a lot. This Index function is great!! It made the complexity very simple!

Answers (2)

Answers (2)

jyothi_anagani
Active Contributor
0 Kudos

Hi Vishal,

Map like This..

AT---->UDF----->AT

While creating the UDF select Queue

UDF code is

for(int i=0;i<a.length;i++)
{
   if(a<i>.equals(ResultList.CC))
   {
       result.addValue(a[i+2]);
   }
}

I have tested this..Working fine...

Get back for any other issues..

Thanks.

former_member181962
Active Contributor
0 Kudos

use the Index function and compare if it is equal to 2 and pass the value of AT if the index equals 2

Regards,

Ravi