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 2005/10/30 06:39:26 UTC
svn commit: r329525 - in /xerces/java/trunk/samples/dom: Counter.java
GetElementsByTagName.java Writer.java
Author: mrglavas
Date: Sat Oct 29 22:39:22 2005
New Revision: 329525
URL: http://svn.apache.org/viewcvs?rev=329525&view=rev
Log:
Add honour-all-schemaLocations option to DOM samples.
Modified:
xerces/java/trunk/samples/dom/Counter.java
xerces/java/trunk/samples/dom/GetElementsByTagName.java
xerces/java/trunk/samples/dom/Writer.java
Modified: xerces/java/trunk/samples/dom/Counter.java
URL: http://svn.apache.org/viewcvs/xerces/java/trunk/samples/dom/Counter.java?rev=329525&r1=329524&r2=329525&view=diff
==============================================================================
--- xerces/java/trunk/samples/dom/Counter.java (original)
+++ xerces/java/trunk/samples/dom/Counter.java Sat Oct 29 22:39:22 2005
@@ -67,6 +67,9 @@
/** Schema full checking feature id (http://apache.org/xml/features/validation/schema-full-checking). */
protected static final String SCHEMA_FULL_CHECKING_FEATURE_ID = "http://apache.org/xml/features/validation/schema-full-checking";
+ /** Honour all schema locations feature id (http://apache.org/xml/features/honour-all-schemaLocations). */
+ protected static final String HONOUR_ALL_SCHEMA_LOCATIONS_ID = "http://apache.org/xml/features/honour-all-schemaLocations";
+
/** Validate schema annotations feature id (http://apache.org/xml/features/validate-annotations). */
protected static final String VALIDATE_ANNOTATIONS_ID = "http://apache.org/xml/features/validate-annotations";
@@ -102,6 +105,9 @@
/** Default Schema full checking support (false). */
protected static final boolean DEFAULT_SCHEMA_FULL_CHECKING = false;
+ /** Default honour all schema locations (false). */
+ protected static final boolean DEFAULT_HONOUR_ALL_SCHEMA_LOCATIONS = false;
+
/** Default validate schema annotations (false). */
protected static final boolean DEFAULT_VALIDATE_ANNOTATIONS = false;
@@ -263,6 +269,7 @@
boolean validation = DEFAULT_VALIDATION;
boolean schemaValidation = DEFAULT_SCHEMA_VALIDATION;
boolean schemaFullChecking = DEFAULT_SCHEMA_FULL_CHECKING;
+ boolean honourAllSchemaLocations = DEFAULT_HONOUR_ALL_SCHEMA_LOCATIONS;
boolean validateAnnotations = DEFAULT_VALIDATE_ANNOTATIONS;
boolean dynamicValidation = DEFAULT_DYNAMIC_VALIDATION;
boolean xincludeProcessing = DEFAULT_XINCLUDE;
@@ -326,6 +333,10 @@
schemaFullChecking = option.equals("f");
continue;
}
+ if (option.equalsIgnoreCase("hs")) {
+ honourAllSchemaLocations = option.equals("hs");
+ continue;
+ }
if (option.equalsIgnoreCase("va")) {
validateAnnotations = option.equals("va");
continue;
@@ -391,6 +402,12 @@
System.err.println("warning: Parser does not support feature ("+SCHEMA_FULL_CHECKING_FEATURE_ID+")");
}
try {
+ parser.setFeature(HONOUR_ALL_SCHEMA_LOCATIONS_ID, honourAllSchemaLocations);
+ }
+ catch (SAXException e) {
+ System.err.println("warning: Parser does not support feature ("+HONOUR_ALL_SCHEMA_LOCATIONS_ID+")");
+ }
+ try {
parser.setFeature(VALIDATE_ANNOTATIONS_ID, validateAnnotations);
}
catch (SAXException e) {
@@ -483,6 +500,8 @@
System.err.println(" NOTE: Not supported by all parsers.");
System.err.println(" -f | -F Turn on/off Schema full checking.");
System.err.println(" NOTE: Requires use of -s and not supported by all parsers.");
+ System.err.println(" -hs | -HS Turn on/off honouring of all schema locations.");
+ System.err.println(" NOTE: Requires use of -s and not supported by all parsers.");
System.err.println(" -va | -VA Turn on/off validation of schema annotations.");
System.err.println(" NOTE: Requires use of -s and not supported by all parsers.");
System.err.println(" -dv | -DV Turn on/off dynamic validation.");
@@ -505,8 +524,12 @@
System.err.println(DEFAULT_VALIDATION ? "on" : "off");
System.err.print(" Schema: ");
System.err.println(DEFAULT_SCHEMA_VALIDATION ? "on" : "off");
- System.err.print(" Schema full checking: ");
+ System.err.print(" Schema full checking: ");
System.err.println(DEFAULT_SCHEMA_FULL_CHECKING ? "on" : "off");
+ System.err.print(" Honour all schema locations: ");
+ System.err.println(DEFAULT_HONOUR_ALL_SCHEMA_LOCATIONS ? "on" : "off");
+ System.err.print(" Validate annotations: ");
+ System.err.println(DEFAULT_VALIDATE_ANNOTATIONS ? "on" : "off");
System.err.print(" Dynamic: ");
System.err.println(DEFAULT_DYNAMIC_VALIDATION ? "on" : "off");
System.err.print(" XInclude: ");
Modified: xerces/java/trunk/samples/dom/GetElementsByTagName.java
URL: http://svn.apache.org/viewcvs/xerces/java/trunk/samples/dom/GetElementsByTagName.java?rev=329525&r1=329524&r2=329525&view=diff
==============================================================================
--- xerces/java/trunk/samples/dom/GetElementsByTagName.java (original)
+++ xerces/java/trunk/samples/dom/GetElementsByTagName.java Sat Oct 29 22:39:22 2005
@@ -56,6 +56,9 @@
/** Schema full checking feature id (http://apache.org/xml/features/validation/schema-full-checking). */
protected static final String SCHEMA_FULL_CHECKING_FEATURE_ID = "http://apache.org/xml/features/validation/schema-full-checking";
+ /** Honour all schema locations feature id (http://apache.org/xml/features/honour-all-schemaLocations). */
+ protected static final String HONOUR_ALL_SCHEMA_LOCATIONS_ID = "http://apache.org/xml/features/honour-all-schemaLocations";
+
/** Validate schema annotations feature id (http://apache.org/xml/features/validate-annotations). */
protected static final String VALIDATE_ANNOTATIONS_ID = "http://apache.org/xml/features/validate-annotations";
@@ -91,6 +94,9 @@
/** Default Schema full checking support (false). */
protected static final boolean DEFAULT_SCHEMA_FULL_CHECKING = false;
+ /** Default honour all schema locations (false). */
+ protected static final boolean DEFAULT_HONOUR_ALL_SCHEMA_LOCATIONS = false;
+
/** Default validate schema annotations (false). */
protected static final boolean DEFAULT_VALIDATE_ANNOTATIONS = false;
@@ -226,7 +232,6 @@
}
// variables
- Counter counter = new Counter();
PrintWriter out = new PrintWriter(System.out);
ParserWrapper parser = null;
String elementName = DEFAULT_ELEMENT_NAME;
@@ -235,6 +240,7 @@
boolean validation = DEFAULT_VALIDATION;
boolean schemaValidation = DEFAULT_SCHEMA_VALIDATION;
boolean schemaFullChecking = DEFAULT_SCHEMA_FULL_CHECKING;
+ boolean honourAllSchemaLocations = DEFAULT_HONOUR_ALL_SCHEMA_LOCATIONS;
boolean validateAnnotations = DEFAULT_VALIDATE_ANNOTATIONS;
boolean dynamicValidation = DEFAULT_DYNAMIC_VALIDATION;
boolean xincludeProcessing = DEFAULT_XINCLUDE;
@@ -293,6 +299,10 @@
schemaFullChecking = option.equals("f");
continue;
}
+ if (option.equalsIgnoreCase("hs")) {
+ honourAllSchemaLocations = option.equals("hs");
+ continue;
+ }
if (option.equalsIgnoreCase("va")) {
validateAnnotations = option.equals("va");
continue;
@@ -358,6 +368,12 @@
System.err.println("warning: Parser does not support feature ("+SCHEMA_FULL_CHECKING_FEATURE_ID+")");
}
try {
+ parser.setFeature(HONOUR_ALL_SCHEMA_LOCATIONS_ID, honourAllSchemaLocations);
+ }
+ catch (SAXException e) {
+ System.err.println("warning: Parser does not support feature ("+HONOUR_ALL_SCHEMA_LOCATIONS_ID+")");
+ }
+ try {
parser.setFeature(VALIDATE_ANNOTATIONS_ID, validateAnnotations);
}
catch (SAXException e) {
@@ -430,6 +446,8 @@
System.err.println(" NOTE: Not supported by all parsers.");
System.err.println(" -f | -F Turn on/off Schema full checking.");
System.err.println(" NOTE: Requires use of -s and not supported by all parsers.");
+ System.err.println(" -hs | -HS Turn on/off honouring of all schema locations.");
+ System.err.println(" NOTE: Requires use of -s and not supported by all parsers.");
System.err.println(" -va | -VA Turn on/off validation of schema annotations.");
System.err.println(" NOTE: Requires use of -s and not supported by all parsers.");
System.err.println(" -dv | -DV Turn on/off dynamic validation.");
@@ -452,8 +470,12 @@
System.err.println(DEFAULT_VALIDATION ? "on" : "off");
System.err.print(" Schema: ");
System.err.println(DEFAULT_SCHEMA_VALIDATION ? "on" : "off");
- System.err.print(" Schema full checking: ");
+ System.err.print(" Schema full checking: ");
System.err.println(DEFAULT_SCHEMA_FULL_CHECKING ? "on" : "off");
+ System.err.print(" Honour all schema locations: ");
+ System.err.println(DEFAULT_HONOUR_ALL_SCHEMA_LOCATIONS ? "on" : "off");
+ System.err.print(" Validate annotations: ");
+ System.err.println(DEFAULT_VALIDATE_ANNOTATIONS ? "on" : "off");
System.err.print(" Dynamic: ");
System.err.println(DEFAULT_DYNAMIC_VALIDATION ? "on" : "off");
System.err.print(" XInclude: ");
Modified: xerces/java/trunk/samples/dom/Writer.java
URL: http://svn.apache.org/viewcvs/xerces/java/trunk/samples/dom/Writer.java?rev=329525&r1=329524&r2=329525&view=diff
==============================================================================
--- xerces/java/trunk/samples/dom/Writer.java (original)
+++ xerces/java/trunk/samples/dom/Writer.java Sat Oct 29 22:39:22 2005
@@ -58,6 +58,9 @@
/** Schema full checking feature id (http://apache.org/xml/features/validation/schema-full-checking). */
protected static final String SCHEMA_FULL_CHECKING_FEATURE_ID = "http://apache.org/xml/features/validation/schema-full-checking";
+ /** Honour all schema locations feature id (http://apache.org/xml/features/honour-all-schemaLocations). */
+ protected static final String HONOUR_ALL_SCHEMA_LOCATIONS_ID = "http://apache.org/xml/features/honour-all-schemaLocations";
+
/** Validate schema annotations feature id (http://apache.org/xml/features/validate-annotations). */
protected static final String VALIDATE_ANNOTATIONS_ID = "http://apache.org/xml/features/validate-annotations";
@@ -99,6 +102,9 @@
/** Default Schema full checking support (false). */
protected static final boolean DEFAULT_SCHEMA_FULL_CHECKING = false;
+ /** Default honour all schema locations (false). */
+ protected static final boolean DEFAULT_HONOUR_ALL_SCHEMA_LOCATIONS = false;
+
/** Default validate schema annotations (false). */
protected static final boolean DEFAULT_VALIDATE_ANNOTATIONS = false;
@@ -475,6 +481,7 @@
boolean externalDTD = DEFAULT_LOAD_EXTERNAL_DTD;
boolean schemaValidation = DEFAULT_SCHEMA_VALIDATION;
boolean schemaFullChecking = DEFAULT_SCHEMA_FULL_CHECKING;
+ boolean honourAllSchemaLocations = DEFAULT_HONOUR_ALL_SCHEMA_LOCATIONS;
boolean validateAnnotations = DEFAULT_VALIDATE_ANNOTATIONS;
boolean generateSyntheticAnnotations = DEFAULT_GENERATE_SYNTHETIC_ANNOTATIONS;
boolean dynamicValidation = DEFAULT_DYNAMIC_VALIDATION;
@@ -525,6 +532,10 @@
schemaFullChecking = option.equals("f");
continue;
}
+ if (option.equalsIgnoreCase("hs")) {
+ honourAllSchemaLocations = option.equals("hs");
+ continue;
+ }
if (option.equalsIgnoreCase("va")) {
validateAnnotations = option.equals("va");
continue;
@@ -604,6 +615,12 @@
System.err.println("warning: Parser does not support feature ("+SCHEMA_FULL_CHECKING_FEATURE_ID+")");
}
try {
+ parser.setFeature(HONOUR_ALL_SCHEMA_LOCATIONS_ID, honourAllSchemaLocations);
+ }
+ catch (SAXException e) {
+ System.err.println("warning: Parser does not support feature ("+HONOUR_ALL_SCHEMA_LOCATIONS_ID+")");
+ }
+ try {
parser.setFeature(VALIDATE_ANNOTATIONS_ID, validateAnnotations);
}
catch (SAXException e) {
@@ -695,6 +712,8 @@
System.err.println(" NOTE: Not supported by all parsers.");
System.err.println(" -f | -F Turn on/off Schema full checking.");
System.err.println(" NOTE: Requires use of -s and not supported by all parsers.");
+ System.err.println(" -hs | -HS Turn on/off honouring of all schema locations.");
+ System.err.println(" NOTE: Requires use of -s and not supported by all parsers.");
System.err.println(" -va | -VA Turn on/off validation of schema annotations.");
System.err.println(" NOTE: Requires use of -s and not supported by all parsers.");
System.err.println(" -ga | -GA Turn on/off generation of synthetic schema annotations.");
@@ -728,7 +747,9 @@
System.err.println(DEFAULT_DYNAMIC_VALIDATION ? "on" : "off");
System.err.print(" Canonical: ");
System.err.println(DEFAULT_CANONICAL ? "on" : "off");
- System.err.print(" Validate Annotations: ");
+ System.err.print(" Honour all schema locations: ");
+ System.err.println(DEFAULT_HONOUR_ALL_SCHEMA_LOCATIONS ? "on" : "off");
+ System.err.print(" Validate Annotations: ");
System.err.println(DEFAULT_VALIDATE_ANNOTATIONS ? "on" : "off");
System.err.print(" Generate Synthetic Annotations: ");
System.err.println(DEFAULT_GENERATE_SYNTHETIC_ANNOTATIONS ? "on" : "off");
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org