You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mr...@apache.org on 2004/06/03 21:41:51 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/impl/dtd XMLDTDValidator.java

mrglavas    2004/06/03 12:41:51

  Modified:    java/src/org/apache/xerces/impl/dtd XMLDTDValidator.java
  Log:
  Grammar Caching and SAX's EntityResolver2:
  
  Do not bother checking the grammar pool if no public or system identifier was provided. 
  Since so many different DTDs have roots in common, using only a root name as the 
  key may cause the wrong grammar to be retrieved from the grammar pool. This scenario
  would occur when an ExternalSubsetResolver has been queried and the
  XMLInputSource returned contains an input stream but no external identifier.
  This can never happen when the instance document specified a DOCTYPE.
  
  Revision  Changes    Path
  1.60      +9 -2      xml-xerces/java/src/org/apache/xerces/impl/dtd/XMLDTDValidator.java
  
  Index: XMLDTDValidator.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/dtd/XMLDTDValidator.java,v
  retrieving revision 1.59
  retrieving revision 1.60
  diff -u -r1.59 -r1.60
  --- XMLDTDValidator.java	25 Apr 2004 05:05:49 -0000	1.59
  +++ XMLDTDValidator.java	3 Jun 2004 19:41:50 -0000	1.60
  @@ -717,7 +717,14 @@
           fDTDGrammar = fGrammarBucket.getGrammar(grammarDesc);
           if(fDTDGrammar == null) {
               // give grammar pool a chance...
  -            if(fGrammarPool != null) {
  +            //
  +            // Do not bother checking the pool if no public or system identifier was provided. 
  +            // Since so many different DTDs have roots in common, using only a root name as the 
  +            // key may cause an unexpected grammar to be retrieved from the grammar pool. This scenario
  +            // would occur when an ExternalSubsetResolver has been queried and the
  +            // XMLInputSource returned contains an input stream but no external identifier.
  +            // This can never happen when the instance document specified a DOCTYPE. -- mrglavas
  +            if (fGrammarPool != null && (systemId != null || publicId != null)) {
                   fDTDGrammar = (DTDGrammar)fGrammarPool.retrieveGrammar(grammarDesc);
               }
           }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org