[jdom-interest] XML Validation Problem

Krushna B krushna at kenati.com
Wed Apr 21 01:40:55 PDT 2004

     I am trying to validate an XML file against an XSD using the 
following code.

SAXBuilder builder = new 
SAXBuilder("org.apache.xerces.parsers.SAXParser", true);
builder.setFeature("http://xml.org/sax/features/validation", true);
Document doc = builder.build(sample.xml);

And I get the error:
Error on line 1 of document file:///usr/local/krushna/sample.xml: 
Document is invalid: no grammar found.

The xsd file is correctly located in the specified location. Why then 
does it say 'no grammar found' ?
Thanks in advance,

More information about the jdom-interest mailing list