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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]