P
pohmart
I am using Xerces 2.6.2 and SAX on Windows2k. I want to validate an XML
doc, which has no schema reference,
with an external schema which is on my PC.
I am setting the following properties and features:
saxParser.setFeature("http://xml.org/sax/features/namespaces", true);
saxParser.setFeature("http://xml.org/sax/features/namespace-prefixes",
true);
saxParser.setFeature("http://xml.org/sax/features/validation", true);
saxParser.setFeature("http://apache.org/xml/features/validation/schema",
true);
saxParser.setFeature("http://apache.org/xml/features/standard-uri-conformant",
false);
saxParser.setProperty("http://apache.org/xml/properties/schema/external-schemaLocation",
"file:///C:/test/testSchema.xsd");
When I parse the document the parser is unable to locate the schema
document.
I have tried several variations for the URL to the schema file such as:
file://localhost/C:/test/testSchema.xsd
C:/test/testSchema.xsd
file:///C|/test/testSchema.xsd
but nothing works.
Can anyone tell me the correct way to do this?
Thanks in advance,
Paul
doc, which has no schema reference,
with an external schema which is on my PC.
I am setting the following properties and features:
saxParser.setFeature("http://xml.org/sax/features/namespaces", true);
saxParser.setFeature("http://xml.org/sax/features/namespace-prefixes",
true);
saxParser.setFeature("http://xml.org/sax/features/validation", true);
saxParser.setFeature("http://apache.org/xml/features/validation/schema",
true);
saxParser.setFeature("http://apache.org/xml/features/standard-uri-conformant",
false);
saxParser.setProperty("http://apache.org/xml/properties/schema/external-schemaLocation",
"file:///C:/test/testSchema.xsd");
When I parse the document the parser is unable to locate the schema
document.
I have tried several variations for the URL to the schema file such as:
file://localhost/C:/test/testSchema.xsd
C:/test/testSchema.xsd
file:///C|/test/testSchema.xsd
but nothing works.
Can anyone tell me the correct way to do this?
Thanks in advance,
Paul