Hi,

I'm using the DOMParser with validation and I would like to be able to
validate the XML that I'm sucking in and parse what I can up to wherever an
error might occur. Currently, the document reference is coming back null. Is
this possible?

I'm porting & enhancing some code so I'm not totally clear on what all the
settings below are doing and the various documentation I've scrounged
(sun.com, apache.org, etc.) haven't answered my question. All comments
welcome.

Regards,
Ed

Some technical stuff...

String xmlDocument = "some_xml_file.xml";

DOMParser parser = new DOMParser(mySymbolTable, myGrammarPool)
parser.setFeature("http://xml.org/sax/features/namespaces";, true);
parser.setFeature("http://xml.org/sax/features/validation";, true);
parser.setFeature("http://apache.org/xml/features/validation/schema";, true);
parser.setFeature("http://apache.org/xml/features/validation/schema-full-che
cking", true);
parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage";,
"http://www.w3.org/2001/XMLSchema";);
parser.parse(xmlDocument);
Document document = parser.getDocument();

This e-mail and any attachments are intended only for use by the
addressee(s) named herein and may contain legally privileged and/or
confidential information. If you are not the intended recipient of this
e-mail, you are hereby notified any dissemination, distribution or copying
of this email, and any attachments thereto, is strictly prohibited. If you
receive this email in error please immediately notify the sender and
permanently delete the original copy and any copy of any e-mail, and any
printout thereof.

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

Reply via email to