Validating xml with xsd schema using xerces

Yona

Usenet Archive
Joined
Oct 16, 2003
Messages
2
Reaction score
0
Im trying to validate an xml file using the xercesDomParser, but it seems like it doesnt validate the xml file. I get an error only if the schema isnt valid.

the code is:
DOMTreeErrorReporter *errReporter = new DOMTreeErrorReporter; parser->setErrorHandler(errReporter);

parser->setDoSchema(TRUE);
parser->setDoNamespaces(TRUE);
parser->setDoValidation(TRUE);
parser->setExternalSchemaLocation("urn:books c:\books.xsd");

parser->setValidationScheme(AbstractDOMParser::Val_Always); parser->setValidationSchemaFullChecking(TRUE); try{ parser->parse(pFileName); } catch{..}...

why doesnt it throw an error when an element has a wrong value or no closing tag??

thanx,
huku
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,208
Messages
3,104,802
Members
249,594
Latest member
henrywalsh

Latest Threads

Top