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 2005/06/14 00:18:32 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/parsers XML11Configuration.java

mrglavas    2005/06/13 15:18:32

  Modified:    java/src/org/apache/xerces/impl/xs XMLSchemaValidator.java
               java/src/org/apache/xerces/parsers XML11Configuration.java
  Log:
  Merge in ignore-schema-location-hints feature from the JAXP 1.3 RI.
  Renamed it use-grammar-pool-only so it covers other cases beyond
  just ignoring schema location hints.
  
  Revision  Changes    Path
  1.176     +19 -3     xml-xerces/java/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java
  
  Index: XMLSchemaValidator.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java,v
  retrieving revision 1.175
  retrieving revision 1.176
  diff -u -r1.175 -r1.176
  --- XMLSchemaValidator.java	13 Jun 2005 04:17:49 -0000	1.175
  +++ XMLSchemaValidator.java	13 Jun 2005 22:18:32 -0000	1.176
  @@ -158,6 +158,10 @@
       protected static final String HONOUR_ALL_SCHEMALOCATIONS = 
           Constants.XERCES_FEATURE_PREFIX + Constants.HONOUR_ALL_SCHEMALOCATIONS_FEATURE;
   
  +    /** Feature identifier: use grammar pool only */
  +    protected static final String USE_GRAMMAR_POOL_ONLY =
  +        Constants.XERCES_FEATURE_PREFIX + Constants.USE_GRAMMAR_POOL_ONLY_FEATURE;
  +
       /** Feature identifier: whether to continue parsing a schema after a fatal error is encountered */
       protected static final String CONTINUE_AFTER_FATAL_ERROR =
           Constants.XERCES_FEATURE_PREFIX + Constants.CONTINUE_AFTER_FATAL_ERROR_FEATURE;
  @@ -219,7 +223,9 @@
               STANDARD_URI_CONFORMANT_FEATURE,
               GENERATE_SYNTHETIC_ANNOTATIONS,
               VALIDATE_ANNOTATIONS,
  -            HONOUR_ALL_SCHEMALOCATIONS};
  +            HONOUR_ALL_SCHEMALOCATIONS,
  +            USE_GRAMMAR_POOL_ONLY};
  +
   
       /** Feature defaults. */
       private static final Boolean[] FEATURE_DEFAULTS = { null,
  @@ -237,6 +243,7 @@
           null,
           null,
           null,
  +        null,
           null};
   
       /** Recognized properties. */
  @@ -293,6 +300,8 @@
       protected boolean fSchemaElementDefault = true;
       protected boolean fAugPSVI = true;
       protected boolean fIdConstraint = false;
  +    protected boolean fUseGrammarPoolOnly = false;
  +
       /** Schema type: None, DTD, Schema */
       private String fSchemaType = null;
   
  @@ -1348,6 +1357,13 @@
           } catch (XMLConfigurationException e) {
               fSchemaType = null;
           }
  +        
  +        try {
  +            fUseGrammarPoolOnly = componentManager.getFeature(USE_GRAMMAR_POOL_ONLY);
  +        } 
  +        catch (XMLConfigurationException e) {
  +            fUseGrammarPoolOnly = false;
  +        }
   
           fEntityResolver = (XMLEntityResolver) componentManager.getProperty(ENTITY_MANAGER);
   
  @@ -2400,7 +2416,7 @@
                       }
                   }
               }
  -            if (grammar == null) {
  +            if (grammar == null && !fUseGrammarPoolOnly) {
                   // try to parse the grammar using location hints from that namespace..
                   try {
                       XMLInputSource xis =
  
  
  
  1.25      +7 -2      xml-xerces/java/src/org/apache/xerces/parsers/XML11Configuration.java
  
  Index: XML11Configuration.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/parsers/XML11Configuration.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- XML11Configuration.java	4 May 2005 03:35:00 -0000	1.24
  +++ XML11Configuration.java	13 Jun 2005 22:18:32 -0000	1.25
  @@ -145,6 +145,10 @@
       /** Feature identifier: honour all schemaLocations */
       protected static final String HONOUR_ALL_SCHEMALOCATIONS = 
           Constants.XERCES_FEATURE_PREFIX + Constants.HONOUR_ALL_SCHEMALOCATIONS_FEATURE;
  +    
  +    /** Feature identifier: use grammar pool only */
  +    protected static final String USE_GRAMMAR_POOL_ONLY =
  +        Constants.XERCES_FEATURE_PREFIX + Constants.USE_GRAMMAR_POOL_ONLY_FEATURE;
           
   	// feature identifiers
   
  @@ -442,7 +446,7 @@
   				NAMESPACES,
                   NORMALIZE_DATA, SCHEMA_ELEMENT_DEFAULT, SCHEMA_AUGMENT_PSVI,
                   GENERATE_SYNTHETIC_ANNOTATIONS, VALIDATE_ANNOTATIONS,
  -                HONOUR_ALL_SCHEMALOCATIONS,
  +                HONOUR_ALL_SCHEMALOCATIONS, USE_GRAMMAR_POOL_ONLY,
               	// NOTE: These shouldn't really be here but since the XML Schema
               	//       validator is constructed dynamically, its recognized
               	//       features might not have been set and it would cause a
  @@ -466,6 +470,7 @@
           fFeatures.put(GENERATE_SYNTHETIC_ANNOTATIONS, Boolean.FALSE);
           fFeatures.put(VALIDATE_ANNOTATIONS, Boolean.FALSE);
           fFeatures.put(HONOUR_ALL_SCHEMALOCATIONS, Boolean.FALSE);
  +        fFeatures.put(USE_GRAMMAR_POOL_ONLY, Boolean.FALSE);
   		fFeatures.put(PARSER_SETTINGS, Boolean.TRUE);
   
           // add default recognized properties
  
  
  

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