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 Borislav Stoyanov <BS...@dspace.de> on 2004/03/03 18:51:20 UTC

RE: Not able to make XercesDOMParser Schema Validation working

Just to close the case:

I wasnt having an error handler of my own and accordingly didnt get any
exceptions thrown in my method, even that I had try-catch arround the
{pParser->parse(XMLFileName)}.

Now after having implementd the class MyErrorHandler : public ErrorHandler 
and doing: pParser->setErrorHandler(myErrorHandler); I can successfully
validate against the schema.

Best regards,

-----Original Message-----
From: Alberto Massari [mailto:amassari@progress.com]
Sent: Friday, February 27, 2004 2:30 PM
To: xerces-c-dev@xml.apache.org
Subject: RE: Not able to make XercesDOMParser Schema Validation working


At 19.56 26/02/2004 +0100, Borislav Stoyanov wrote:
>10nx SchemeLocation value was not complete (namespace was missing).
>
>I cannt still get it validated though. One thing is still unclear: all the
>elements in the file have the prefix XX:Element
>which in normal situation is given by xmlns:XX="http://www.mynamespace.de".
>How can this be also considered? (maybe afterthat it will work)

I'm sorry, but I don't understand what you are saying; what do you mean 
with "in normal situation"? do you mean that you have elements like 
prefix:name but the prefix is not declared?
Could you please post the complete XML and XSD file? Otherwise this will 
become a long thread leading nowhere...

Alberto

>-----Original Message-----
>From: Alberto Massari [mailto:amassari@progress.com]
>Sent: Thursday, February 26, 2004 6:47 PM
>To: xerces-c-dev@xml.apache.org
>Subject: RE: Not able to make XercesDOMParser Schema Validation working
>
>
>At 18.42 26/02/2004 +0100, Borislav Stoyanov wrote:
> >10nx I tried this but it didnt help. I cannt find any working examples in
> >Inet either.
>
>What is the value of SchemeLocation? Is it the correct "uri location" (the
>URI of the namespace, followed by one space, followed by the location of
>the schema)?
>
>Alberto
>
> >-----Original Message-----
> >From: Alberto Massari [mailto:amassari@progress.com]
> >Sent: Thursday, February 26, 2004 6:15 PM
> >To: xerces-c-dev@xml.apache.org
> >Subject: RE: Not able to make XercesDOMParser Schema Validation working
> >
> >
> >At 18.06 26/02/2004 +0100, Borislav Stoyanov wrote:
> > >I forgot, Im using Xeces 2.1.0.
> >
> >Have you added setDoNamespace(true)? without namespace, no schema
> >validation can be done.
> >
> >Alberto
> >
> >
> > >-----Original Message-----
> > >From: Borislav Stoyanov
> > >Sent: Thursday, February 26, 2004 6:03 PM
> > >To: 'xerces-c-dev@xml.apache.org'
> > >Subject: Not able to make XercesDOMParser Schema Validation working
> > >
> > >
> > >Hi, I have been trying to validate an XML document with a schema
grammar
> > >that I pre-parse before parsing the main document. My schema grammar
>parses
> > >successfully, but I've not been able to apply it to the parsing of the
> > >target XML document. Help! I am using the XercesDOMParser APIs as
>follows:
> > >         pParser = TL_NEW XercesDOMParser();
> > >         pParser->setExternalSchemaLocation(SchemeLocation);
> > >         pParser->setDoSchema(true);
> > >         pParser->setDoValidation(true);
> > >
> > >         try
> > >         {
> > >                 pParser->parse(XMLFileName);
> > >                 pDocument = (DOMDocument*)pParser->getDocument();
> > >         } catch (...)
> > >         {
> > >                 ... nothing happens
> > >
> > >I'll appreciate if you can help.
> > >
> > >Best regards,
> > >
> > >---------------------------------------------------------------------
> > >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
> >
> >
> >
> >---------------------------------------------------------------------
> >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
>
>
>
>---------------------------------------------------------------------
>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



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