You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Using XPath's with Predicates as Variables

Accepted answer
37
Views
2
Comments
edited Mar 6, 2019 6:21AM in Integration 2 comments

Summary

When using an xpath with a predicate, it works directly, i.e. element[1], but using a variable does not error, but does not return the correct node. Always returns the first node.

Content

I have an issue in OICS that I am unable to get working at the moment.
So say the following XPATH in an Assign
 
$GetNucNameUpdates/nsmpr2:GetNucNameUpdatesOutputCollection/nsmpr2:GetNucNameUpdatesOutput[2]/nsmpr2:NAME_CTR
 
This will work fine and return the correct node at position 2.
 
But if I now make the predicate a variable, it doesn't error, but only ever returns the 1st node.
 
$GetNucNameUpdates/nsmpr2:GetNucNameUpdatesOutputCollection/nsmpr2:GetNucNameUpdatesOutput[$LoopRecordCount]/nsmpr2:NAME_CTR

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!