From: Wolfgang M. <wol...@ex...> - 2004-11-26 11:08:39
|
Hi Tobias, XPathAPI expects the method Node.getParentNode() to return null if called on the root element. eXist returned the document node - which I thought to be the correct behaviour, but I'm not sure. You thus have to change org.exist.dom.NodeImpl.getParentNode() as follows: public Node getParentNode() { long pid = getParentGID(); return pid < 0 ? null : ownerDocument.getNode(pid); } Also, NodeImpl.getParentGID() has to be changed to handle gid < 0: public long getParentGID() { return XMLUtil.getParentId(ownerDocument, gid); } Cheers, Wolfgang P.S.: I would like to include your test case into the standard test suite. Would that be ok? The disclaimer does not permit it. |