Handling of document-node

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Handling of document-node

Timo Boehme
Hi,

since I do some research on XPath I was interested in how eXist handles
document nodes.
So the first question is: does eXist have a notion of a document node?

If yes, the following behaviour seems a little bit odd (I did the tests
with the demo server):
- doc("/db/shakespeare/plays/macbeth.xml")
   - should return the document-node, eXist defines this function to
     return a node
   - the demo server returns the string-value of this node (all text), ok

- doc("/db/shakespeare/plays/macbeth.xml")/PLAY
   - returns the PLAY root element, ok

- doc("/db/shakespeare/plays/macbeth.xml")/PLAY/..
   or
   doc("/db/shakespeare/plays/macbeth.xml")/PLAY/../PLAY
   - return empty sequence,
     however if we have a document-node and PLAY is a children of it
     (like the second query suggests) the parent of PLAY must be the
     document-node so I had assumed a result like in query 1 or 2

The following query shows a related problem:

   doc("/db/shakespeare/plays/macbeth.xml")//ACT/ancestor::node()/PLAY

Since the document node should be in the set of ancestor nodes the query
should return the root node PLAY. However the empty sequence is returned.

So either eXist does not have the notion of a document node as it is
defined in the specs or there is a bug in the implementation of parent
and ancestor axis.


Kind regards,
Timo


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open