[xml] proximity position in libxml2's xmlXPathEvalExpression()
- From: Marius Konitzer <m konitzer gmx de>
- To: xml gnome org
- Subject: [xml] proximity position in libxml2's xmlXPathEvalExpression()
- Date: Wed, 18 Oct 2006 23:14:18 +0200
Consider the following XML document:
<test><!-- a --><somenode><!-- b --></somenode><!-- c --></test>
and let libxml2 evaluate the XPath expression "//comment()" on it.
libxml2 returns node-set (a,c,b) instead of (a,b,c), that I would have
expected. To be exact, "(//comment())[2]" gives singleton (c) instead of
the expected (b).
W3C's XPath recommendation indeed states, that predicates are to
determine "the position of the node in the node-set ordered in document
order if the axis is a forward axis" [1], which should be the case here.
Don't hesitate to call me a fool for this stupid-looking question, I
probably just got something terribly wrong, right?
Marius
[1] http://www.w3.org/TR/xpath.html#predicates
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]