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);
}
|