You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by kamal gupta <ka...@yahoo.com> on 2005/03/09 04:14:29 UTC

Help on Validating schema

Hi,

I have downloaded PAthan 2.0 and Xerces 2.6. 

I am trying to add schema validation in Pathan
Examples under samples/basic/ by calling following
APIs:

I have a schema file data.xsd and I am calling
loadGrammer API to load the schema file as follows:

short grammarType = XERCES Grammar::SchemaGrammarType;
XERCES Grammar* grammer =
xmlParser->loadGrammar("data.xsd", grammarType, true);

I used xmlParser->setFeature API to set following
features to true:

XMLUni::fgDOMNamespaces
XMLUni::fgDOMValidation
XMLUni::fgXercesSchema
XMLUni::fgXercesSchemaFullChecking

the call to API
document = xmlParser->parseURI("data.xml");
seems to be returning document but when I evaluate
XPATH expression on it, I don't get any result  and I
can get result of XPATH expresion if I turn off
XMLUni::fgDOMNamespaces.

I have validated data.xsd and data.xml with some tool
on the net and the files seems to be proper.

Any advise/suggestion on what I could be doing wrong.

In addition when I tried setting feature
"XMLUni::fgXercesValidationErrorAsFatal" to  true, it
turns out the document->getDocumentElement returns
NULL.

Any help on this would be greatly appreciated.

Thanks
Kamal.





	
		
__________________________________ 
Celebrate Yahoo!'s 10th Birthday! 
Yahoo! Netrospective: 100 Moments of the Web 
http://birthday.yahoo.com/netrospective/

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


RE: Help on Validating schema

Posted by Matthew Berry <ma...@apt.com>.
Kamal,

Two things to try:

*/ Set the feature: XMLUni::fgXercesUseCachedGrammarInParse
*/ Have you installed a custom error handler with setErrorHandler() to trap
validation errors.

Good luck

-----Original Message-----
From: kamal gupta [mailto:kamaalg@yahoo.com]
Sent: 09 March 2005 03:14
To: kamaalg@yahoo.com
Subject: Help on Validating schema


Hi,

I have downloaded PAthan 2.0 and Xerces 2.6.

I am trying to add schema validation in Pathan
Examples under samples/basic/ by calling following
APIs:

I have a schema file data.xsd and I am calling
loadGrammer API to load the schema file as follows:

short grammarType = XERCES Grammar::SchemaGrammarType;
XERCES Grammar* grammer =
xmlParser->loadGrammar("data.xsd", grammarType, true);

I used xmlParser->setFeature API to set following
features to true:

XMLUni::fgDOMNamespaces
XMLUni::fgDOMValidation
XMLUni::fgXercesSchema
XMLUni::fgXercesSchemaFullChecking

the call to API
document = xmlParser->parseURI("data.xml");
seems to be returning document but when I evaluate
XPATH expression on it, I don't get any result  and I
can get result of XPATH expresion if I turn off
XMLUni::fgDOMNamespaces.

I have validated data.xsd and data.xml with some tool
on the net and the files seems to be proper.

Any advise/suggestion on what I could be doing wrong.

In addition when I tried setting feature
"XMLUni::fgXercesValidationErrorAsFatal" to  true, it
turns out the document->getDocumentElement returns
NULL.

Any help on this would be greatly appreciated.

Thanks
Kamal.







__________________________________
Celebrate Yahoo!'s 10th Birthday!
Yahoo! Netrospective: 100 Moments of the Web
http://birthday.yahoo.com/netrospective/

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org