[jdom-interest] DTD Validation with SAXBuilder()

Jing Chen jchen at centor.com
Thu Jun 17 10:17:57 PDT 2004


Hi, 

I am trying to validate the XML with DTD with the following code. I wrote an
invalidate xml for testing, but the code did not catch it (where
MyErrorHandler extends BuilderErrorHandler). Can you tell what went wrong?
Thanks!!

SAXBuilder builder = new SAXBuilder (true);
builder.setValidation(true);
MyErrorHandler handler = new MyErrorHandler();
builder.setErrorHandler(handler);
reportsParamDoc = new SAXBuilder().build(file);
if (!handler.isValid)
System.exit(-1); 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jdom.org/pipermail/jdom-interest/attachments/20040617/c2d16bd4/attachment.htm


More information about the jdom-interest mailing list