Hi, I want to force the parser to always validate the xml instances against a unique XSD.
Here's part of my code:

       File schema = new File("./temp/schema.xsd");
XmlOptions opt = new XmlOptions();
       opt.setDocumentType(XmlObject.Factory.parse(schema).schemaType());
       opt.setValidateOnSet();
ConsultaDocument doc = ConsultaDocument.Factory.parse(XMLSource,opt);

But I get an exception on the last line: Exception in thread "main" java.lang.ClassCastException: org.apache.xmlbeans.impl.xb.xsdschema.impl.SchemaDocumentImpl

What's wrong with it?



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to