Hello all
In my orchestration I have a xml variable like this:
<form>
<routes>
<route>
<elements>
<foo>xxx</foo>
<foo>yyy</foo>
<foo>zzz</foo>
</elements>
<elements>
<foo>ee</foo>
<foo>ii</foo>
<foo>kk</foo>
<foo>aa</foo>
</elements>
</route>
<route>
<elements>
<foo>xxx</foo>
</elements>
<elements>
<foo>ff</foo>
<foo>mmm</foo>
</elements>
</route>
</routes>
</form>
I use a setValue/decisionPoint combination to iterate through it, first of all I get the routes count with an xPath and start a counter like this:
/process_data/@routesCount = count(/process_data/xmlVar/routes/route)
/process_data/@routesCounter = /process_data/@routesCounter +1
Then I go on to iterate inside that routes/route[1] node using the same method, I want to get the number of 'foo' elements inside route[1] so I have the setValue:
/process_data/@fooCount = count(/process_data/xmlVar/routes/route[/process_data/@routesCounter]/elements/foo)
but I'm getting the total foo count of the entire document (10) instead of 3
I have done recording/playback several times, the @routesCount and @routesCounter index work fine, but I always get 10 for the @fooCount.
When I execute the XPath query:
count(/form/routes/route[1]/elements/foo)
in Oxygen I get 3 for a result
Somehow LC is not taking the @routesCounter index into consideration when querying the XML
Have you tried to do this double-iteration stuff?
Thanks for your help
Solved! Go to Solution.
Views
Replies
Total Likes
This worked for me.
The attached ES2 .lca contains the XML and the schema used in the archived process.
Steve
Views
Replies
Total Likes
This worked for me.
The attached ES2 .lca contains the XML and the schema used in the archived process.
Steve
Views
Replies
Total Likes
As the matter of fact, I have checked out some similar process I have working, and noticed I was missing a number() function.
The indices must be cast to number before being able to iterate, so:
/process_data/@fooCount = count(/process_data/xmlVar/routes/route[number(/process_data/@routesCounter)]/elements/foo)
works fine.
Anyway, the intermediate XML var tip was useful too.
Thank you.
Views
Replies
Total Likes