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 2008/05/14 05:47:12 UTC
svn commit: r656094 -
/xerces/java/trunk/src/org/apache/xerces/jaxp/validation/XMLSchemaFactory.java
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