From: Evert H. <eve...@pi...> - 2004-03-20 14:34:32
|
Hi, I have found a case where XPath evaluates incorrectly. I have tested it with Xalan too and Xalan does it correctly. The xml is the following: <section id="a"> <section id="b"> <section id="c"/> </section> </section> I am trying to select "b" and all its parents, thus "a" and "b". Here is the XPath expression that I used: //section[descendant-or-self::section[@id='b']] eXist only returns "b". Xalan returns "a" and "b". Do you know of another way in which I can select a node with all its parents? In Xalan I can do it in two steps: I can first select the node via its ID and then I can use this node as a context node for the next XPath expression which will then just get the ancestors. I haven't found a way to specify a context node in eXist. Thanks in advance, Evert |