0

I have this sample XML:

<Values>
<TraceSet Name = "EVT1.Val" QuerySpecName="EVT1" >
<Events>
<Properties>
<Property Descriptor="100">1406538933</Property>
<Property Descriptor="2000">My second value</Property>
</Properties>
</Events>
<TraceSet Name = "EVT2.Val" QuerySpecName="EVT2" >
<Events>
<Properties>
<Property Descriptor="100">1406538922</Property>
<Property Descriptor="2000">My first value</Property>
</Properties>
</Events>
</Values>

I am trying to iterate at the Property Descriptor = 2000 level, sorting by Property Descriptor = 100 (UTC Seconds) but I can'[t find a way to do it in XPath 1.0.

The result should be:

My first value
My second value

Is there a way of comparing ALL UTC seconds in this structure and show the respective values in order?

D. Caan
  • 1,907
  • 6
  • 22
  • 36

1 Answers1

1

I am trying to iterate at the Property Descriptor = 2000 level, sorting by Property Descriptor = 100 (UTC Seconds) but I can'[t find a way to do it in XPath 1.0.

There isn't a way to do it purely in XPath 1.0 as there's no concept of sorting and iterating in XPath 1.0 per se. XPath expressions simply select sets of nodes from the source document, it's up to the host language from which you are executing the XPath expressions to do any iterating or sorting of the selected nodes.

Ian Roberts
  • 120,891
  • 16
  • 170
  • 183
  • Can I select the values in order instead of iterating? – D. Caan Aug 06 '14 at 14:18
  • @Dalek not in pure XPath, no. The XPath expression tells you which nodes to select, not what to do with them. What language or tool are you using to execute these XPaths? – Ian Roberts Aug 06 '14 at 14:19