Skip to Main Content

DevOps, CI/CD and Automation

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!

How to return unique value from xquery for by searching list of values

User_650TASep 2 2011 — edited Sep 5 2011
Hi

My response is ProductList and ItemList. Based on the passed in Item/Type the xquery should check the following conditions are return unique value

If passed in value exists then
return "exists"
else if (count(item)>5) then
return "maxLimit"
else
"notExist"

<ProductIdentificationResponse>
<!-- LIST OF PRODUCTS -->
<ProductList>
<Product>
<!-- LIST OF ITEMS -->
<ItemList>
<Item>
<Type>ITM22</Type>
<Value>5555</Value>
</Item>

<Item>
<Type>ITM22</Type>
<Value>6666</Value>
</Item>

<Item>
<Type>ITM22</Type>
<Value>7777</Value>
</Item>

</ItemList>
</Product>
</ProductList>
</ProductIdentificationResponse>



I have return the xquery as follows but not working

for $x in $ProductIdentificationResponse1/ProductList/Product/ItemList/Item
return
if ($passedParam/text() = $x/Value/text()) then
( "Exists" )
else if (count( $ProductIdentificationResponse1/ProductList/Product/ItemList/Item) > 5) then
("maxLimit")
else
("notExist")
};


Any help will be appreciated

Thank you

Edited by: user11310683 on Sep 2, 2011 4:25 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 3 2011
Added on Sep 2 2011
4 comments
489 views