This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
This concerns the validity of L3 Core tests entities02, entities03, infoset01, infoset02 and nodegettextcontent18, all of which involve the child lists of Entity or Entity Reference nodes. DOM L3 Spec states that "When the replacement value is available, the corresponding Entity node's child list represents the structure of that replacement text. Otherwise, the child list is empty." In Xerces, the parser has the replacement value available only when the entity is referenced in the parsed document for several reasons. In the entities and infoset tests, an entity reference node that was not referenced in the parsed document is created and appended to the DOM tree. Its' child nodeList is subsequently null and hence normalize document can not normalize or replace such entity references with their replacement text. As the 'entities' parameter is set to false, the entity reference is removed, however the replacement text is null and the comparison between the actual and expected 'nodeValue'/'nodeName' of its parent element will fail. An entity reference node that is referenced in the parsed document can be created and appended instead, in the case of entities02 and infoset01, without affecting the purpose of the tests. In nodegettextcontent18, getTextContent is called on an entity that has not been referenced in the document. The test could be modified to check getTextContent on an entity referenced in the document (ie; beta), while still testing the same functionality.
My first reactions is that this looks like one for the IG to resolve. The replacement value should have been in the internal subset and would processed by the XML parser and ignored by the DOM builder. The tests interpret that this information was available, but ignored.
Leaving aside the issue of ignoring unreferenced entity declarations, the entity reference should not be removed when its contents are unavailable. DOM3 Core Rec states in the "entities" parameter text that "unexpanded entity references are kept in the document".