Here is an example where if the user asks for my DTD, I make sure that I always use
the one in the installation directory. There is no reason why you could not ignore
the DTD requested by the user and return an InputSource for whatever DTD you like.
InputSource* SAXResolver::resolveEntity(const XMLCh* const xsPublicId, const XMLCh*
const xsSystemId)
{
TCHAR szSystemId[XML_IDLEN];
XMLString::transcode(xsSystemId, szSystemId, XML_IDLEN - 1);
if (_tcscmp(szSystemId, MYDTD) == 0) {
CString strPath;
/// Get installation path from registry.
if (theApp.GetInstallPath(strPath)) {
strPath += _T('\\');
strPath += MYDTD;
XMLCh xsDtd[_MAX_PATH];
XMLString::transcode(strPath, xsDtd, _MAX_PATH - 1);
return new LocalFileInputSource(xsDtd);
}
}
return NULL;
}
Adam Heinz
Development Consultant
Exstream Software
2424 Harrodsburg Road, Suite 200
Lexington, KY 40503
(859) 219.8137
(859) 223.9737 fax
[EMAIL PROTECTED]
connecting with the eGeneration
www.exstream.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]