Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Xpath in BPEL: How to find the "count" of multiple nodes

User_DBMQ2Jan 1 2009 — edited Feb 26 2020
Hi Guys
I am having a problem(syntax error) in XPath Expression creation.

Using the Batch processing in BPEL I am trying to find out the number of occurences of an XML element (node).

I have done this successfully previously using:

count(bpws:getVariableData('Receive_Read_InputVariable','ProductDataeXchangePackage','/ns5:ProductDataeXchangePackage/ns5:Items/ns5:Item'))

But when i am using the following:

count(bpws:getVariableData('inputVariable','payload','/ns1:ProductDataeXchangePackage/ns1:Items/ns1:Item[bpws:getVariableData('CurrentItem')]/ns1:BillOfMaterial/ns1:BillOfMaterialItem'))

Here there are multiple occurences of the "Item" tag within which the BillOfMaterial/*BillOfMaterialItem* occurs.
'CurrentItem' is a integer type variable.

It is throwing an Error saying Expected ) --which obviously doesnt solves the problem.

The best part is when i am hard coding a numerical value like:

count(bpws:getVariableData('inputVariable','payload','/ns1:ProductDataeXchangePackage/ns1:Items/ns1:Item[2]/ns1:BillOfMaterial/ns1:BillOfMaterialItem'))

it is Working perfectly fine--showing the number of "BillOfMaterialItem" occurences under the 2nd (or nth for that matter, where n is the numerical) "Item" node.

Please help
--thanks
debashis
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 12 2013
Added on Jan 1 2009
3 comments
2,815 views