I'm using OSM
7.2.0.3 and I have cartridge with an Order Recognition Rule
, with its Order Data Rule
(inside Transformation tab)
In the ODR I have this XQuery code:
declare namespace im="http://xxx";
declare namespace xs="http://www.w3.org/2001/XMLSchema";
declare variable $ord := fn:root(.)/im:Order;
<_root>
<Order>
{
for $moli in $ord/MainOrderLineItem
return
$moli/LineItemAttributeInfo/LineItemAttribute
}
</Order>
</_root>
The XML input to the OSM is:
<ord:CreateOrder
xmlns:ord="http://xmlns.oracle.com/communications/ordermanagement">
<im:Order xmlns:im="http://xxx"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.oracle.com/communications/sce/dictionary/BaseOrderCommonCartridge/DataDictionary_BaseOrderCommon ../dataDictionary/DataDictionary_BaseOrderCommon.xsd">
<OrderHeader>
<OrderID>12345</OrderID>
<RevisionNumber>1</RevisionNumber>
</OrderHeader>
<MainOrderLineItem>
<LineItemAttributeInfo>
<LineItemAttribute>
<AttributeID>1234</AttributeID>
</LineItemAttribute>
</LineItemAttributeInfo>
</MainOrderLineItem>
<MainOrderLineItem>
<LineItemAttributeInfo>
<LineItemAttribute>
<AttributeID>5678</AttributeID>
</LineItemAttribute>
</LineItemAttributeInfo>
</MainOrderLineItem>
<MainOrderLineItem>
<LineItemAttributeInfo>
<LineItemAttribute>
<AttributeID>abcd</AttributeID>
</LineItemAttribute>
</LineItemAttributeInfo>
</MainOrderLineItem>
</im:Order>
</ord:CreateOrder>
There are 3 occurences of <MainOrderLineItem>
's but the output is only 1:
<LineItemAttribute xmlns:im="http://xxx" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<AttributeID>1234</AttributeID>
</LineItemAttributeInfo>
Why is it not looping?
Thanks a lot for your replies.
The problem is here:
Must be: