W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2002

Re: validation problem with xerces 2

From: Franz-Josef Herpers <franz-josef.herpers@spmtechnologies.com>
Date: Sat, 2 Mar 2002 10:22:48 +0100
Message-ID: <75FE1C8FE217E945AFBF635BFB505D31996CC8@fallback.spmtechnologies.com>
To: xmlschema-dev@w3.org, "'Igor Novak'" <igor.novak@uni-mb.si>
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:29 GMT