Yes, your code is definitly incorrect. You have to specfiy the XSD in URL syntax: file:///example.xsd <file:///example.xsd> (or file:///c:/foo/example.xsd <file:///c:/foo/example.xsd> , or whereever the file is located).
-----Urspr�ngliche Nachricht----- Von: Burris, Eddie [mailto:[EMAIL PROTECTED] Gesendet am: Donnerstag, 24. Oktober 2002 01:13 An: [EMAIL PROTECTED] Betreff: Validating with external Schema 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 { SAXParser saxParser = factory.newSAXParser(); XMLReader reader = saxParser.getXMLReader(); reader.setFeature(" http://xml.org/sax/features/validation <http://xml.org/sax/features/validation> ", true); reader.setFeature(" http://apache.org/xml/features/validation/schema <http://apache.org/xml/features/validation/schema> ", true); reader.setProperty( " http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation <http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation> ", "example.xsd"); File xmlFile = new File("example.xml"); DefaultHandler handler = new SAXSchema2(); saxParser.parse(xmlFile, handler); } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
