I have an XML schema where there is a repeating inner node. There is a possibility that the Inner Node count can be 0. If the inner node value is not passed in the XML file, it is throwing a mapping exception. I need the count of inner node and map it only if the count is greater than 0. How can it be done in Biztalk Mapper?
Here is the sample XML file :
<ns0:OrderDetails xmlns:ns0="http://OrderDetails.Input">
<OrderNo>10</OrderNo>
<OrderName>OrderName_0</OrderName>
<Description>Description_0</Description>
<TotalAmount>10</TotalAmount>
<OrderItemDetails><!-- Repeating Node -->
<ItemID>ItemID_0</ItemID>
<ItemName>ItemName_0</ItemName>
<ItemDescription>ItemDescription_0</ItemDescription>
<Quantity>10</Quantity>
<UnitPrice>10</UnitPrice>
<TotalItemPrice>10</TotalItemPrice>
</OrderItemDetails>
<OrderItemDetails>
<ItemID>ItemID_0</ItemID>
<ItemName>ItemName_0</ItemName>
<ItemDescription>ItemDescription_0</ItemDescription>
<Quantity>10</Quantity>
<UnitPrice>10</UnitPrice>
<TotalItemPrice>10</TotalItemPrice>
</OrderItemDetails>
<OrderItemDetails>
<ItemID>ItemID_0</ItemID>
<ItemName>ItemName_0</ItemName>
<ItemDescription>ItemDescription_0</ItemDescription>
<Quantity>10</Quantity>
<UnitPrice>10</UnitPrice>
<TotalItemPrice>10</TotalItemPrice>
</OrderItemDetails>
</ns0:OrderDetails>