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);
}
Hi Vikas,
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