[ 
https://issues.apache.org/jira/browse/XERCESJ-1595?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13500625#comment-13500625
 ] 

Eric Sirois commented on XERCESJ-1595:
--------------------------------------

Hi Radu,


Just want to confirm the changes that you're suggesting.

1) In org.apache.xerces.impl.xs.XSDDescription
     a) equals()
         else // fNamespace == null
                if (desc.getLiteralSystemId() != null)     //added if statement 
to check and use systemID.
                        return 
fLiteralSystemId.equals(desc.getLiteralSystemId()); 
                else  return desc.getTargetNamespace() == null;
    }

     b)  return (fNamespace == null) ? fLiteralSystemId.hashCode() : 
fNamespace.hashCode();   //added  fLiteralSystemId.hashCode() after ? instead 
of existing 0

2)in org.apache.xerces.impl.xs.XMLSchemaValidator.findSchemaGrammar(short, 
String, QName, QName, XMLAttributes) 

 if (grammar == null) {
            fXSDDescription.setNamespace(namespace);
            fXSDDescription.setLiteralSystemId(fExternalNoNamespaceSchema);  
//add this line


I recompiled xercesImpl.jar and used it in DITA OT 1.6 to process 
doc/articles/DITA-articles.ditmap where the map and DITA-domains.xml are using 
XSD for validation instead of DTDs and it working fine.

Eric
                
> Xerces grammar pool not working with no namespace XSDs
> ------------------------------------------------------
>
>                 Key: XERCESJ-1595
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1595
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XNI
>    Affects Versions: 2.11.0
>            Reporter: Eric Sirois
>             Fix For: 2.11.0
>
>
> When loading XSDs with no namespace into the Xerces grammar pool, it assumes 
> every XSD with no namespace to be the same XSD doc.  In our case, when trying 
> to validate DITA documents, there could be a number of different types of 
> documents involved, for example map, topic, task and concepts.
> To get around the issue we need to ignore XSDs when loading the grammar pool. 
>  This affects the time needed to produce/transform documentation 
> significantly.
> If a namespace is available for the XSD, the grammar cache should use that. 
> If the there is no namespace available, then it should use the system ID of 
> the schema.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to