[jdom-interest] XML Validation Problem

Krushna B krushna at kenati.com
Wed Apr 21 03:29:39 PDT 2004


Hi agian,
      It worked with the setting mentioned at 
http://jdom.org/docs/faq.html#a0360.
Thanks for the help.
Regards,
Krushna

Per Norrman wrote:

> Your feature setting is wrong. Look here:
> http://jdom.org/docs/faq.html#a0360
>
> /pmn
>
> Krushna B wrote:
>
>> Hi,
>>     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);
>> builder.setProperty("http://apache.org/xml/properties/schema/external-schemaLocation", 
>> "file:///usr/local/krushna/xsdvalid-25p1/xsd_file.xsd");
>> 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,
>> Krushna
>>
>> _______________________________________________
>> To control your jdom-interest membership:
>> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com 
>>
>>
>
>




More information about the jdom-interest mailing list