This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 670 - Child nodeLists of Entity/Entity Reference nodes may be null
Summary: Child nodeLists of Entity/Entity Reference nodes may be null
Status: ASSIGNED
Alias: None
Product: DOM TS
Classification: Unclassified
Component: DOM Level 3 (show other bugs)
Version: unspecified
Hardware: Other other
: P2 normal
Target Milestone: ---
Assignee: Philippe Le Hegaret
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-13 17:35 UTC by nnissar
Modified: 2004-05-22 23:57 UTC (History)
0 users

See Also:


Attachments

Description nnissar 2004-04-13 17:35:49 UTC
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.
Comment 1 Curt Arnold 2004-05-08 02:46:11 UTC
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.
Comment 2 Andrew Clover 2004-05-22 19:57:25 UTC
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".