I have a pile o’ XML that has a bunch of nodes in sequence, like this:
. . .
<foo bar="42" />
<foo bar="43" />
<foo bar="44" />
. . .
When I do an XPath like this:
myXmlDoc.Xql("//foo")
It appears as though I’m not always getting the results back in the order in which they appear in the document. I read somewhere that XPath 1.0 doesn’t guarantee result order – is that what’s going on here?
If so, is there a way to force the results of an Xql query to be returned in document order (short of going to XPath 2.0, which may or may not be on Xojo’s radar)?
I suppose I could stuff each Xql result into an array element, then sort the array, but this seems overkill.
Thanks for any suggestions!