cancel
Showing results for 
Search instead for 
Did you mean: 

Create node only if it belongs to a specified parent

Former Member
0 Kudos

Hi,

similar to my last post [where I looked for the last node,|], I need something more complicated.

The XSL expression looks like this:

<xsl:for-each select="Node1/Node2 position() = last()]/Node3[1]/Node_Header[Qualifier = 'AB']/Node_Position">

The last node, Node_Position, is just a structure node which contains fields and can appear 1..n.

So in my graphical mapping I need to create a target structure with the amount of Node_Position, but only for

the last appearance of Node2. I tried to set the context of Node_Positon to the context of Node2 and use the

UDF with result.addValue(a[a.length - 1]); (see link above). But this returns - of course - only the last

Node_Postion of all.

How can I check, if th Node_Position is in the context of the last appearance of Node2?

Thanks

Chris

Accepted Solutions (0)

Answers (1)

Answers (1)

jyothi_anagani
Active Contributor
0 Kudos

Hi,

Can you be more clear...

Give your source and Target structures properly...

And give some Example how you want...So that we can help you...

Thanks.

Former Member
0 Kudos

Source:

Node1

....Node2 (only last position of this node is relevant) occ 1...n

........Node3 occ 0..1

..........Node4(Header) (occ 1...n)

.............Field1 Qualf (to ne checked for Value ABC)

.............Node5(Postion) (occ 1..n)

..................Field2

Target:

TNode1

......TNode2 (should be created as often as Node5 exist in LAST Node2)

..........TNode3

...................TField1 (insert Field2 where Field1 = ABC)

Hope this helps.

Thanks

Chris