Re: [xml] xpath and the document order

On Sat, 2005-05-07 at 01:29 +0400, Oleg A. Paraschenko wrote:

  as I understand, the function "xmlXPathEvalExpression" doesn't have to
return nodes in the document order. So here are questions.

1) Could you show an example of XML and XPath, for which
   "xmlXPathEvalExpression" returns nodes not in the document order?

This most often happens in conjunction with the // operator,
with alternation (Xpath 2 only) and with the reverse axes such
as preceding-sibling.

2) What should be used for sorting a set of nodes:

"xmlXPathNodeSetSort" from "xpath.c" from libxml2, or
"xsltDocumentSortFunction" from "xsltutils.c" from libxslt?

Doesn't it depend whether you are sorting by document order or
by some other key?


Liam Quin, W3C XML Activity Lead,
Pictures from old books:
IRC (chat) programs:

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]