Re: [xml] xpath and the document order



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

  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

-- 
Liam Quin, W3C XML Activity Lead, http://www.w3.org/People/Quin
Pictures from old books: http://www.holoweb.net/~liam/pictures/oldbooks/
IRC (chat) programs: www.ircreviews.org/clients/




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