Mathew Thank you so much for the reply. Adding
ErrorHandler got me to the point of getting validation
errors if any.
I am still not able to see why XPATH expression
evaluation is got giving me any result even when the
XML document is validated against the schema.
Is there specific namespace binding I need to do using
PathanNSResolver::addNamespaceBinding API.
I have tried following but this didn't help.
pathanResolver->addNamespaceBinding(X("xs"),X("http://www.w3.org/2001/XMLSchema"));
Any suggestion on this issue will be welcome.
Thanks
Kamal
--- Matthew Berry <[EMAIL PROTECTED]> wrote:
> 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:[EMAIL PROTECTED]
> Sent: 09 March 2005 03:14
> To: [EMAIL PROTECTED]
> 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:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>
>
__________________________________
Celebrate Yahoo!'s 10th Birthday!
Yahoo! Netrospective: 100 Moments of the Web
http://birthday.yahoo.com/netrospective/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]