xerces-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mirko Braun <Mirko.Br...@Softing.com>
Subject AW: DOMBuilder and DOMEntityResolver (with another address)
Date Tue, 02 Nov 2004 08:12:46 GMT
 Hi Alberto,

 your statement was a great help.
 Thank you very much.

 Mirko 

-----Urspr√ľngliche Nachricht-----
Von: Alberto Massari [mailto:amassari@progress.com] 
Gesendet: Montag, 1. November 2004 11:09
An: xerces-c-dev@xml.apache.org
Betreff: Re: DOMBuilder and DOMEntityResolver (with another address)


At 08.27 29/10/2004 +0200, Mirko Braun wrote:
>Hi to all,
>
>i want to use the DOMEntityResolver to use an external Schema because 
>the
>Schema
>is not in the same directory as the xml file.
>I think i have to overwrite the resolveentity() method of the 
>DOMEntityResolver  but
>i'm not quite sure how to do this. I think i have to use the 
>DOMInputSource too.
>
>Can anybody help me?

Yes, you have to define a class derived from DOMEntityResolver, implement 
the resolveEntity() method, then pass the pointer to an instance of this 
class to the DOMBuilder::setEntityResolver method.

The code in the entity resolver should be something like this:

MyEntityResolver::resolveEntity(const   XMLCh* const    publicId
         , const XMLCh* const    systemId
         , const XMLCh* const    baseURI)
{
         if( *test for publicId and/or systemId* )
         {
                 LocalFileInputSource* is=new LocalFileInputSource(NULL, 
"c:\\reals_schema.xsd");
                 return new Wrapper4InputSource(is);
         }
         return NULL;
}

Hope this helps,

Alberto 



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


Mime
View raw message