xerces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mrgla...@apache.org
Subject svn commit: r656094 - /xerces/java/trunk/src/org/apache/xerces/jaxp/validation/XMLSchemaFactory.java
Date Wed, 14 May 2008 03:47:12 GMT
Author: mrglavas
Date: Tue May 13 20:47:11 2008
New Revision: 656094

URL: http://svn.apache.org/viewvc?rev=656094&view=rev
Log:
Added newSchema() method which allows an application to create a Schema from an XMLGrammarPool.

Modified:
    xerces/java/trunk/src/org/apache/xerces/jaxp/validation/XMLSchemaFactory.java

Modified: xerces/java/trunk/src/org/apache/xerces/jaxp/validation/XMLSchemaFactory.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/jaxp/validation/XMLSchemaFactory.java?rev=656094&r1=656093&r2=656094&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/jaxp/validation/XMLSchemaFactory.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/jaxp/validation/XMLSchemaFactory.java Tue May
13 20:47:11 2008
@@ -269,6 +269,17 @@
         return schema;
     }
     
+    public Schema newSchema(XMLGrammarPool pool) throws SAXException {
+        // If the "use-grammar-pool-only" feature is set to true
+        // prevent the application's grammar pool from being mutated
+        // by wrapping it in a ReadOnlyGrammarPool.
+        final AbstractXMLSchema schema = (fUseGrammarPoolOnly) ? 
+            new XMLSchema(new ReadOnlyGrammarPool(pool)) : 
+            new XMLSchema(pool, false);
+        propagateFeatures(schema);
+        return schema;
+    }
+    
     public boolean getFeature(String name) 
         throws SAXNotRecognizedException, SAXNotSupportedException {
         if (name == null) {



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


Mime
View raw message