Author: mrglavas
Date: Sat Oct 29 22:19:30 2005
New Revision: 329521
URL: http://svn.apache.org/viewcvs?rev=329521&view=rev
Log:
Add honour-all-schemaLocations option to SAX samples.
Modified:
xerces/java/trunk/samples/sax/Counter.java
xerces/java/trunk/samples/sax/DocumentTracer.java
xerces/java/trunk/samples/sax/Writer.java
Modified: xerces/java/trunk/samples/sax/Counter.java
URL:
http://svn.apache.org/viewcvs/xerces/java/trunk/samples/sax/Counter.java?rev=329521&r1=329520&r2=329521&view=diff
==============================================================================
--- xerces/java/trunk/samples/sax/Counter.java (original)
+++ xerces/java/trunk/samples/sax/Counter.java Sat Oct 29 22:19:30 2005
@@ -75,6 +75,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";
@@ -113,6 +116,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;
@@ -354,6 +360,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;
@@ -431,6 +438,10 @@
schemaFullChecking = option.equals("f");
continue;
}
+ if (option.equalsIgnoreCase("hs")) {
+ honourAllSchemaLocations = option.equals("hs");
+ continue;
+ }
if (option.equalsIgnoreCase("va")) {
validateAnnotations = option.equals("va");
continue;
@@ -529,6 +540,15 @@
System.err.println("warning: Parser does not support feature
("+SCHEMA_FULL_CHECKING_FEATURE_ID+")");
}
try {
+ parser.setFeature(HONOUR_ALL_SCHEMA_LOCATIONS_ID,
honourAllSchemaLocations);
+ }
+ catch (SAXNotRecognizedException e) {
+ System.err.println("warning: Parser does not recognize feature
("+HONOUR_ALL_SCHEMA_LOCATIONS_ID+")");
+ }
+ catch (SAXNotSupportedException e) {
+ System.err.println("warning: Parser does not support feature
("+HONOUR_ALL_SCHEMA_LOCATIONS_ID+")");
+ }
+ try {
parser.setFeature(VALIDATE_ANNOTATIONS_ID,
validateAnnotations);
}
catch (SAXNotRecognizedException e) {
@@ -637,6 +657,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.");
@@ -664,8 +686,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/sax/DocumentTracer.java
URL:
http://svn.apache.org/viewcvs/xerces/java/trunk/samples/sax/DocumentTracer.java?rev=329521&r1=329520&r2=329521&view=diff
==============================================================================
--- xerces/java/trunk/samples/sax/DocumentTracer.java (original)
+++ xerces/java/trunk/samples/sax/DocumentTracer.java Sat Oct 29 22:19:30 2005
@@ -80,6 +80,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";
@@ -126,6 +129,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;
@@ -800,6 +806,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 dynamicValidation = DEFAULT_DYNAMIC_VALIDATION;
boolean xincludeProcessing = DEFAULT_XINCLUDE;
@@ -859,6 +866,10 @@
schemaFullChecking = option.equals("f");
continue;
}
+ if (option.equalsIgnoreCase("hs")) {
+ honourAllSchemaLocations = option.equals("hs");
+ continue;
+ }
if (option.equalsIgnoreCase("va")) {
validateAnnotations = option.equals("va");
continue;
@@ -945,6 +956,15 @@
System.err.println("warning: Parser does not support feature
("+SCHEMA_FULL_CHECKING_FEATURE_ID+")");
}
try {
+ parser.setFeature(HONOUR_ALL_SCHEMA_LOCATIONS_ID,
honourAllSchemaLocations);
+ }
+ catch (SAXNotRecognizedException e) {
+ System.err.println("warning: Parser does not recognize feature
("+HONOUR_ALL_SCHEMA_LOCATIONS_ID+")");
+ }
+ catch (SAXNotSupportedException e) {
+ System.err.println("warning: Parser does not support feature
("+HONOUR_ALL_SCHEMA_LOCATIONS_ID+")");
+ }
+ try {
parser.setFeature(VALIDATE_ANNOTATIONS_ID,
validateAnnotations);
}
catch (SAXNotRecognizedException e) {
@@ -1055,6 +1075,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.");
@@ -1080,8 +1102,12 @@
System.err.println(DEFAULT_LOAD_EXTERNAL_DTD ? "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/sax/Writer.java
URL:
http://svn.apache.org/viewcvs/xerces/java/trunk/samples/sax/Writer.java?rev=329521&r1=329520&r2=329521&view=diff
==============================================================================
--- xerces/java/trunk/samples/sax/Writer.java (original)
+++ xerces/java/trunk/samples/sax/Writer.java Sat Oct 29 22:19:30 2005
@@ -73,6 +73,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";
@@ -122,6 +125,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;
@@ -566,6 +572,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;
@@ -628,6 +635,10 @@
schemaFullChecking = option.equals("f");
continue;
}
+ if (option.equalsIgnoreCase("hs")) {
+ honourAllSchemaLocations = option.equals("hs");
+ continue;
+ }
if (option.equalsIgnoreCase("va")) {
validateAnnotations = option.equals("va");
continue;
@@ -723,6 +734,15 @@
System.err.println("warning: Parser does not support feature
("+SCHEMA_FULL_CHECKING_FEATURE_ID+")");
}
try {
+ parser.setFeature(HONOUR_ALL_SCHEMA_LOCATIONS_ID,
honourAllSchemaLocations);
+ }
+ catch (SAXNotRecognizedException e) {
+ System.err.println("warning: Parser does not recognize feature
("+HONOUR_ALL_SCHEMA_LOCATIONS_ID+")");
+ }
+ catch (SAXNotSupportedException e) {
+ System.err.println("warning: Parser does not support feature
("+HONOUR_ALL_SCHEMA_LOCATIONS_ID+")");
+ }
+ try {
parser.setFeature(VALIDATE_ANNOTATIONS_ID,
validateAnnotations);
}
catch (SAXNotRecognizedException e) {
@@ -843,6 +863,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.");
@@ -878,7 +900,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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]