diff --git a/java/src/org/apache/xml/resolver/apps/xread.java b/java/src/org/apache/xml/resolver/apps/xread.java
index 3c7717b..0c5d3e4 100644
--- a/java/src/org/apache/xml/resolver/apps/xread.java
+++ b/java/src/org/apache/xml/resolver/apps/xread.java
@@ -90,6 +90,8 @@ import org.apache.xml.resolver.helpers.Debug;
*
Perform a well-formed parse, not a validating parse.
* -v (the default)
* Perform a validating parse.
+ * -s
+ * Enable W3C XML Schema validation.
* -n
* Perform a namespace-ignorant parse.
* -N (the default)
@@ -123,6 +125,7 @@ public class xread
int maxErrs = 10;
boolean nsAware = true;
boolean validating = true;
+ boolean useSchema = false;
boolean showWarnings = (debuglevel > 2);
boolean showErrors = true;
Vector catalogFiles = new Vector();
@@ -144,6 +147,11 @@ public class xread
continue;
}
+ if (args[i].equals("-s")) {
+ useSchema = true;
+ continue;
+ }
+
if (args[i].equals("-n")) {
nsAware = false;
continue;
@@ -196,6 +204,9 @@ public class xread
try {
reader.setFeature("http://xml.org/sax/features/namespaces", nsAware);
reader.setFeature("http://xml.org/sax/features/validation", validating);
+ if (useSchema) {
+ reader.setFeature("http://apache.org/xml/features/validation/schema", true);
+ }
} catch (SAXException e) {
// nop;
}