Is there a problem
with setting the XML Schema file inside your program using the
external-noNamespaceSchemaLocation property? The following code is returning an
error that suggests it can't find the schema file???
Eddie
------------------------------------------------------------------------------------------
factory.setNamespaceAware(true);
try {
try {
SAXParser saxParser =
factory.newSAXParser();
XMLReader reader =
saxParser.getXMLReader();
reader.setFeature("http://xml.org/sax/features/validation",
true);
reader.setFeature("http://apache.org/xml/features/validation/schema", true);
reader.setProperty(
"http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",
"example.xsd");
reader.setFeature("http://apache.org/xml/features/validation/schema", true);
reader.setProperty(
"http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",
"example.xsd");
File xmlFile = new
File("example.xml");
DefaultHandler handler = new SAXSchema2();
DefaultHandler handler = new SAXSchema2();
saxParser.parse(xmlFile,
handler);
}
}
