Y
Yona
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
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