xerces-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alberto Massari <amass...@progress.com>
Subject Re: DOMBuilder and DOMEntityResolver (with another address)
Date Mon, 01 Nov 2004 10:08:51 GMT
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 
>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, 
                 return new Wrapper4InputSource(is);
         return NULL;

Hope this helps,


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

View raw message