cancel
Showing results for 
Search instead for 
Did you mean: 

Determine last position

Former Member
0 Kudos

Hi,

in XSL mapping I have following command: position()=last()

It returns the last apperance of a given node.

Is there any simple soloution to do the same in graphical mapping?

Thanks

Chris

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Thanks for this information

jyothi_anagani
Active Contributor
0 Kudos

Hi Christian,

Map like this..

input---->UDF---->output

While writing the UDF select Context

UDF code..

result.addValue(a[a.length - 1]);

This is working.

I have tested.

Check it...

Thanks.

Former Member
0 Kudos

Hi Jyothi,

awesome. It really works that simple.

My problem was that I have to check if the grandfather node is the last one:

main node

-->node to check (occ 1..n)

-


> node (occ 0..1)

-


> field

But because the field is (of course) also in a context and the direct parent node could

only appear once at least, it works

Thanks.

Points for you.

Edited by: Christian Riekenberg on Aug 27, 2009 3:45 PM

Answers (2)

Answers (2)

former_member181962
Active Contributor
0 Kudos

Hi Christian,

You can try the following.

check this image which shows how i did it using graphical mapping:

http://www.flickr.com/photos/41818237@N02/3862193420/

Regards,

Ravi

MichalKrawczyk
Active Contributor
0 Kudos

hi,

>>>Is there any simple soloution to do the same in graphical mapping?

I don't think so - you need to write an UDF to handle it

Regards,

Michal Krawczyk