You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "Tagir Valeev (JIRA)" <xe...@xml.apache.org> on 2014/11/02 14:47:33 UTC

[jira] [Updated] (XERCESJ-1649) Dubious calls to CoreDocumentImpl.isXMLName

     [ https://issues.apache.org/jira/browse/XERCESJ-1649?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tagir Valeev updated XERCESJ-1649:
----------------------------------
    Issue Type: Improvement  (was: Bug)

> Dubious calls to CoreDocumentImpl.isXMLName
> -------------------------------------------
>
>                 Key: XERCESJ-1649
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1649
>             Project: Xerces2-J
>          Issue Type: Improvement
>    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: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org