Author: mrglavas
Date: Tue May 13 20:48:37 2008
New Revision: 656095
URL: http://svn.apache.org/viewvc?rev=656095&view=rev
Log:
Added newSchema() method which allows an application to create a Schema from an
XMLGrammarPool.
Also fixed a minor bug. Should be setting be setting "fully composed" to false
on the instance
of XMLSchema if the "use-grammar-pool-only" feature is false.
Modified:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/validation/BaseSchemaFactory.java
Modified:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/validation/BaseSchemaFactory.java
URL:
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/validation/BaseSchemaFactory.java?rev=656095&r1=656094&r2=656095&view=diff
==============================================================================
---
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/validation/BaseSchemaFactory.java
(original)
+++
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/validation/BaseSchemaFactory.java
Tue May 13 20:48:37 2008
@@ -236,7 +236,7 @@
}
}
else {
- schema = new XMLSchema(new ReadOnlyGrammarPool(pool), fXSDVersion);
+ schema = new XMLSchema(new ReadOnlyGrammarPool(pool), false,
fXSDVersion);
}
propagateFeatures(schema);
return schema;
@@ -257,6 +257,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), fXSDVersion) :
+ new XMLSchema(pool, false, fXSDVersion);
+ 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]