Re: validation problem with xerces 2

Hi Igor,

you have to set a new feature in Xerces2: the schema validation feature:
parser.setFeature("http://apache.org/xml/features/validation/schema", true);

Otherwise Xerces 2 searches for a DTD.

Cheers
Franz

> -----Ursprüngliche Nachricht-----
> Von: Igor Novak [mailto:igor.novak@uni-mb.si]
> Gesendet: Donnerstag, 28. Februar 2002 16:31
> An: xmlschema-dev@w3.org
> Betreff: validation problem with xerces 2
> 
> 
> Hi,
> 
> I'm using SDK 1.4 rc and xerces to validate an XML document,
> but every thing works fine with Xerces 1.4.4 but in Xerces 2.0.0 I get
> errors.
> 
> I'm using sample sax.Counter (or dom.Counter) that comes
> with Xerces 2.0 and I try to validate XML document with that sample.
> 
> java -classpath
> "...\xercesImpl.jar;...\xercesSamples.jar;...\xmlParserAPIs.jar;."
> sax.Counter -v ...\xerces-2_0_0\data\personal-schema.xml
> 
> with classpath I override SDK 1.4 Crimson parser (it really 
> overrides it)
> and in data directory is personal.xsd so everythig should be 
> fine but it's
> not, I get error:
> 
> [Error] personal-schema.xml:3:98: Document root element 
> "personnel", must
> match
> DOCTYPE root "null".
> [Error] personal-schema.xml:3:98: Document is invalid: no 
> grammar found.
> 
> I also tried other XML documents and Shemas but the errors 
> are the same. But
> if I try the same example with Xerces 1.4.4 everything is fine!!??
> 
> Help, help !
> 
> 
> Thanks,
> 
> Igor Novak
> 
> 

Received on Saturday, 2 March 2002 04:23:23 UTC