Tagir Valeev created XERCESJ-1649:
-------------------------------------
Summary: Dubious calls to CoreDocumentImpl.isXMLName
Key: XERCESJ-1649
URL: https://issues.apache.org/jira/browse/XERCESJ-1649
Project: Xerces2-J
Issue Type: Bug
Affects Versions: 2.11.0
Reporter: Tagir Valeev
Priority: Minor
I was just analyzing the Xerces source code (ver 2.11.0) and found some dubious
code.
First, in class org.apache.xerces.dom.DOMNormalizer in method protected Node
normalizeNode (Node node) there's a branch (around line #495):
{noformat}
if (fDocument.errorChecking && ((fConfiguration.features &
DOMConfigurationImpl.WELLFORMED) != 0) &&
fDocument.isXMLVersionChanged()){
CoreDocumentImpl.isXMLName(node.getNodeName() ,
fDocument.isXML11Version());
}
{noformat}
However CoreDocumentImpl.isXMLName seems to have no side effect, just return
the boolean value which is ignored. Probably adding DOM error was forgotten
here?
The similar case is in org.apache.xml.serialize.DOMSerializerImpl, method
private void verify (Node node, boolean verifyNames, boolean xml11Version),
around line #1000:
{noformat}
case Node.ENTITY_REFERENCE_NODE: {
// only if entity is preserved in the tree
if (verifyNames && (features & ENTITIES) != 0){
CoreDocumentImpl.isXMLName(node.getNodeName() , xml11Version);
}
break;
}
{noformat}
Probably it's not so big issue, I just wanted to draw your attention to this
code.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]