Re: Version 3.0 now available!
Brought to you by:
bs_php,
nigelswinson
From: Nigel S. <nig...@us...> - 2002-05-09 22:36:07
|
> This is great news. I will replace it on the systems I use it at (namely at > http://questml.com and http://outer-court.com/tech/forum.htm ) and of course > do some Beta testing. > > BTW is it normal that e.g. > "myElement | myOtherElement" > (or maybe ".//myElement | .//myOtherElement") > will return the elements not in the order they appear in the XML, but in the > order as listed in the XPath-string? Hmmm, I'm not sure. > I wish they could be listed as appearing in the XML, as this is the result I > get from MSXML. Is it not standardized, and up to the XPath-parser to decide > the returned order, or simply a PHPXPath bug? Could be. Looking at the XPath spec it says ========================== The primary syntactic construct in XPath is the expression. An expression matches the production Expr. An expression is evaluated to yield an object, which has one of the following four basic types: a.. node-set (an ***unordered*** collection of nodes without duplicates) b.. boolean (true or false) c.. number (a floating-point number) d.. string (a sequence of UCS characters) ========================== So we don't have to guarentee anything at all about the order. If you could locate something for us that says that the way we do it is wrong then we can happily change it. I agree with you that it is probably more useful to be in the doc order. Perhaps what we should do is to have a sort function. It takes a function (An XPath expression?) that will determine which of two nodes are "greater" and bubble sorts the list? Nigel |