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/12/16 18:06:48 UTC
svn commit: r727090 -
/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/validation/BaseSchemaFactory.java
Author: mrglavas
Date: Tue Dec 16 09:06:48 2008
New Revision: 727090
URL: http://svn.apache.org/viewvc?rev=727090&view=rev
Log:
Fixing a bug. The schema version should be set in the constructor
of the SchemaFactory and should not be mutable. The user already
selected the version of XML Schema they wanted when they created
the factory.
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=727090&r1=727089&r2=727090&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 Dec 16 09:06:48 2008
@@ -93,7 +93,7 @@
private static final String SECURITY_MANAGER =
Constants.XERCES_PROPERTY_PREFIX + Constants.SECURITY_MANAGER_PROPERTY;
- /** Property identifier: SecurityManager. */
+ /** Property identifier: XML Schema version. */
private static final String XML_SCHEMA_VERSION =
Constants.XERCES_PROPERTY_PREFIX + Constants.XML_SCHEMA_VERSION_PROPERTY;
@@ -126,7 +126,7 @@
private boolean fUseGrammarPoolOnly;
/** Whether the XML Schema is 1.1 or not */
- private String fXSDVersion;
+ private final String fXSDVersion;
BaseSchemaFactory(String xsdVersion) {
fErrorHandlerWrapper = new ErrorHandlerWrapper(DraconianErrorHandler.getInstance());
@@ -134,6 +134,7 @@
fXMLGrammarPoolWrapper = new XMLGrammarPoolWrapper();
fXMLSchemaLoader.setFeature(SCHEMA_FULL_CHECKING, true);
fXMLSchemaLoader.setProperty(XMLGRAMMAR_POOL, fXMLGrammarPoolWrapper);
+ fXMLSchemaLoader.setProperty(XML_SCHEMA_VERSION, xsdVersion);
fXMLSchemaLoader.setEntityResolver(fDOMEntityResolverWrapper);
fXMLSchemaLoader.setErrorHandler(fErrorHandlerWrapper);
fXSDVersion = xsdVersion;
@@ -417,10 +418,10 @@
SAXMessageFormatter.formatMessage(getLocale(),
"property-not-supported", new Object [] {name}));
}
- if (name.equals(XML_SCHEMA_VERSION)) {
- fXSDVersion = (String) object;
- fXMLSchemaLoader.setProperty(XML_SCHEMA_VERSION, fXSDVersion);
- return;
+ else if (name.equals(XML_SCHEMA_VERSION)) {
+ throw new SAXNotSupportedException(
+ SAXMessageFormatter.formatMessage(getLocale(),
+ "property-read-only", new Object [] {name}));
}
try {
fXMLSchemaLoader.setProperty(name, object);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org