W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2001

EntityReference nodes and tree positon

From: K. Ari Krupnikov <ari@cogsci.ed.ac.uk>
Date: Thu, 26 Apr 2001 15:59:41 +0100
Message-ID: <3AE837DD.D2E0CB1@cogsci.ed.ac.uk>
To: www-dom@w3.org
CC: dbdom-devel@lists.sourceforge.net
A DOM tree may include entity reference nodes in the tree, if such
references were reported by the parser. All children of the relevant
entity are copied as children of the entity reference node. So
someEntityRef.getLastChild().getNextSibling() will always be null. Am I
correct so far?

Now consider the following fragment:

<!ENTITY c "<c/>">

As far as XPath, or the Infoset are concerned, the next sibling of the
element c, which is the last child of entity c, is the element d
(whitespace ignored).

Is there an obvious solution to this difference, or is it the XPath
implementation's responsibility to translate getNextSibling() to
getParentNode().getNextSibling() in the case of nodes that are children
of entity references?

Received on Thursday, 26 April 2001 10:59:49 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:08 UTC