How do I guarante node order for an Xpath 'OR' query
- by Tom Carter
I have a snippet of XML that looks like
<body>
Some text....
<nodeA>....</nodeA>
more text
<someOtherNode>
<nodeA>.......</nodeA>
</someOtherNode>
<nodeB>.......</nodeB>
etc.....
</body>
I'm selecting all nodeA and NodeB nodes inside <body> using an XPATH query similar to
"//nodeA|//nodeB"
As I understand it, .NET supports XPATH 1.0 which does not guarantee node order.
How can I guarantee selected nodes are returned in document order in my OR query : that's to say :
nodeA, nodeA, nodeB