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/17 13:54:59 UTC

svn commit: r727364 - in /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/validation: XMLSchema11Factory.java XMLSchemaFactory.java

Author: mrglavas
Date: Wed Dec 17 04:54:58 2008
New Revision: 727364

URL: http://svn.apache.org/viewvc?rev=727364&view=rev
Log:
Reducing code duplication. Just use the strings that are already available in the Constants class.

Modified:
    xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/validation/XMLSchema11Factory.java
    xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/validation/XMLSchemaFactory.java

Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/validation/XMLSchema11Factory.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/validation/XMLSchema11Factory.java?rev=727364&r1=727363&r2=727364&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/validation/XMLSchema11Factory.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/validation/XMLSchema11Factory.java Wed Dec 17 04:54:58 2008
@@ -19,6 +19,8 @@
 
 import javax.xml.validation.SchemaFactory;
 
+import org.apache.xerces.impl.Constants;
+
 /**
  * {@link SchemaFactory} for XML Schema.
  *
@@ -26,12 +28,9 @@
  * @version $Id$
  */
 public final class XMLSchema11Factory extends BaseSchemaFactory {
-    
-    /** Schema Version 1.1 */
-    private static final String W3C_XML_SCHEMA11_NS_URI = "http://www.w3.org/XML/XMLSchema/v1.1";
 
     public XMLSchema11Factory() {
-        super(W3C_XML_SCHEMA11_NS_URI);
+        super(Constants.W3C_XML_SCHEMA11_NS_URI);
     }
 
     public boolean isSchemaLanguageSupported(String schemaLanguage) {
@@ -44,7 +43,7 @@
                     "SchemaLanguageLengthZero", null));
         }
         // only W3C XML Schema 1.1 is supported
-        return schemaLanguage.equals(W3C_XML_SCHEMA11_NS_URI);
+        return schemaLanguage.equals(Constants.W3C_XML_SCHEMA11_NS_URI);
     }
 
 } // XMLSchema11Factory

Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/validation/XMLSchemaFactory.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/validation/XMLSchemaFactory.java?rev=727364&r1=727363&r2=727364&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/validation/XMLSchemaFactory.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/validation/XMLSchemaFactory.java Wed Dec 17 04:54:58 2008
@@ -20,6 +20,8 @@
 import javax.xml.XMLConstants;
 import javax.xml.validation.SchemaFactory;
 
+import org.apache.xerces.impl.Constants;
+
 /**
  * {@link SchemaFactory} for XML Schema.
  *
@@ -28,11 +30,8 @@
  */
 public final class XMLSchemaFactory extends BaseSchemaFactory {
 
-    /** Schema Version 1.0 */
-    private static final String W3C_XML_SCHEMA10_NS_URI = "http://www.w3.org/XML/XMLSchema/v1.0";
-
     public XMLSchemaFactory() {
-        super(W3C_XML_SCHEMA10_NS_URI);
+        super(Constants.W3C_XML_SCHEMA10_NS_URI);
     }
     
     /**
@@ -57,11 +56,8 @@
                     "SchemaLanguageLengthZero", null));
         }
         // only W3C XML Schema 1.0 is supported
-        if (schemaLanguage.equals(XMLConstants.W3C_XML_SCHEMA_NS_URI)) {
-            return true;
-        }
-
-        return schemaLanguage.equals(W3C_XML_SCHEMA10_NS_URI);
+        return schemaLanguage.equals(XMLConstants.W3C_XML_SCHEMA_NS_URI) || 
+            schemaLanguage.equals(Constants.W3C_XML_SCHEMA10_NS_URI);
     }
 
 } // XMLSchemaFactory



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