This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
The tests level3/core/nodecomparedocumentposition29 level3/core/textreplacewholetext07 both specify the implementationAttribute expandEntityReferences true, but then try to access the child nodes of entity references. The implementationAttribute should be set to false. textreplacewholetext07 has a further problem. It expects a NO_MOD error when replacing the wholeText of a Text node adjacent to an entity reference. However the reference contains only an element and a PI: there are no logically adjacent text nodes, so replaceWholeText doesn't touch it and no exception is raised. For this test to work, a new entity would need to be added to staffNS.xml containing both text and non-textual nodes. Finally, nodegettextcontent17 also sets expandEntityReferences to true and then creates an entity reference. Whilst I haven't seen any definition of what *exactly* this implementationAttribute should do, it would be helpful if it coincided with the Level 3 DOMConfiguration parameter 'entities'. In this case entities are expanded and doctype.entities is empty, so this text won't create the desired entity reference properly. Suggest setting expandEntityReferences to false here, since the test has no reason to need true.
Created attachment 97 [details] Fix for nodecomparedocumentposition29, textreplacewholetext07 caution: patches staffNS.xml
Most implementation attributes are lifted from JAXP (jaxp.xml.parsers.DocumentBuilderFactory) and predate the DOMConfiguration properties. Setting expandEntityReferences to true forces the implementation to expand entity references when loading documents. If the processor can not expand entity references, the test is skipped. The entity definitions should be preserved and it is possible to create entity references after loading. As is done in this case. It is not equivalent with 'entities', since that also requires the elimination of entity definitions. I agree with your interpretation on textreplacewholetext07 that a NO_MODIFICATION_ERR is not appropriate. The entity reference does not contain any logically adjacent text node, it would not be removed and therefore would not trigger the clause about entity references containing non-text. Changing staffNS.xml has too many potential implications (I'm sure there is a test somewhere that expects a specific number of entities). I have rewritten the expectations of textreplacewholetext07 and added textreplacewholetext08 which does have an entity reference with logically-adjacent text and should result in a NO_MODIFICATION_ERR. nodecomparedocumentposition29 and nodegettextcontent17 seemed reasonable. They asserted that they required entities to be expanded, however I could see nothing in the test that required that setting. In addition, they declared that the loaded documents were not changed when they were.
Created attachment 122 [details] Changes expectation of textreplacewholetext07, adds 08 and supporting files
A few other L3 Core tests documentadoptnode16, notesettextcontent11, and 12 unecessarily restricted the test to implementations that did not expand entity references. nodesetuserdata08 had two different code paths, one that would always work that was used when entity references were expanded and one that dependend on entity references being preserved. This was split into two tests, one that always creates an entity reference and one that is only applicable to non-expanding implementations (nodesetuserdata10). The changes for these tests appear in a patch for bug412.