'XPath Param Value Is Not Evaluating In Expression
The @Value='1' Does not seem to be evaluating in this expression below as it returns both nodes of SEventData instead of only one that has a @Value of '1'. What am I missing?
Source:
<CData>
<SData SKey="006" >
<SEventData SEventOID="UNS" SEventRepeatKey="2">
<FData FOID="REQUIRED" FRepeatKey="1">
<ItemGroupData ItemGroupOID="REQUIRED" ItemGroupRepeatKey="0"
TransactionType="Upsert">
<ItemData ItemOID="REQ" Value="0" />
</ItemGroupData>
</FData>
</SEventData>
<SEventData SEventOID="UNS" SEventRepeatKey="3">
<FData FOID="REQUIRED" FRepeatKey="1">
<ItemGroupData ItemGroupOID="REQUIRED" ItemGroupRepeatKey="0"
TransactionType="Upsert">
<ItemData ItemOID="REQ" Value="1" />
</ItemGroupData>
</FData>
</SEventData>
</SData>
</CData>
with expression
//CData[.//SData[@SKey='006']/SEventData/FData/ItemGroupData/ItemData[@ItemOID='REQ' and @Value='1']]//SEventData
returns both instead of one
Element='<SEventData SEventOID="UNS" SEventRepeatKey="2">
<FData FOID="REQUIRED" FRepeatKey="1">
<ItemGroupData ItemGroupOID="REQUIRED"
ItemGroupRepeatKey="0"
TransactionType="Upsert">
<ItemData ItemOID="REQ" Value="0"/>
</ItemGroupData>
</FData>
</SEventData>'
Element='<SEventData SEventOID="UNS" SEventRepeatKey="3">
<FData FOID="REQUIRED" FRepeatKey="1">
<ItemGroupData ItemGroupOID="REQUIRED"
ItemGroupRepeatKey="0"
TransactionType="Upsert">
<ItemData ItemOID="REQ" Value="1"/>
</ItemGroupData>
</FData>
</SEventData>'
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
