header file
------------------------------------------------------
class EsXml4cDomEntityResolver : public DOMEntityResolver
{
public:
 EsXml4cDomEntityResolver();
virtual ~EsXml4cDomEntityResolver();
DOMInputSource* resolveEntity(const XMLCh* const publicId, const XMLCh* const systemId, const XMLCh* const baseURI);
}
 
cpp file
-------------------------------------------------------
DOMInputSource* EsXml4cDomEntityResolver::resolveEntity(const XMLCh* const publicId, const XMLCh* const systemId, const XMLCh* const baseURI)
{
InputSource* result = NULL;
 
/** customize it the way you want **/
LocalFileInputSource* fileinput = NULL;
str.append(catRWPrefix.c_str()); // catRWPrefix will be empty for DTDs
DOMString tmp(str.c_str());
fileinput = new LocalFileInputSource(tmp.rawBuffer(), correctSid);
std::ifstream in;
     EsXMLCh xstr(fileinput->getSystemId());
 
     in.open(xstr.c_str());
     if (in.is_open())
     {
       result = fileinput;
       //std::cout << "path + file " << xstr.c_str() << "\n str : " << str.c_str()<< "\n tmpSid :"<< tmpSid.c_str() << std::endl;
       //printf("Correct Sid=%ws\n", correctSid);
     }
 return new Wrapper4InputSource(result);
}
-----Original Message-----
From: Kirill.Shiff [mailto:[EMAIL PROTECTED]
Sent: 05 July 2004 20:23
To: [EMAIL PROTECTED]
Subject: Re: Subject: how to use external schema?

Hi Vikas,
 
I founded your post on '[EMAIL PROTECTED]'. It seems I have a problem you already solved.
I have external DTD file and need to use it instead of internal (ignore internal one).
Could you please send some source example how you managed to achieve it?
 
Thank you in advance
 
 
Kirill
 
 
 
 
> > > Hi All,
> > >
> > > I am trying to parse my file against a schema. Before I was parsing it
> > > against a external DTD and it was working fine going through my entity
> > > resolver. As soon as I try to use schema it stops going into entity
> > > resolver.
> > > I know I can set the schema location into the parser using
> > > setExternalSchemaLocation() function but to do that I will have to
> > extract
> > > this info from xml file manually. I do not want to do that. I want
> > > something
> > > like entity resolver for schema.
> > > Thanks & Regards
> > > Vikas

Reply via email to