7#include <xercesc/validators/schema/SchemaSymbols.hpp>
10#include <xercesc/util/XMLUniDefs.hpp>
11#include <xercesc/util/XMLString.hpp>
14#include <xercesc/framework/LocalFileInputSource.hpp>
15#include <xercesc/internal/XMLScanner.hpp>
16#include <xercesc/sax/Locator.hpp>
19 XERCES_CPP_NAMESPACE_USE
39 const XMLCh* publicId = xmlRI->getPublicId();
40 const XMLCh* systemId = xmlRI->getSystemId();
41 const XMLCh* baseURI = xmlRI->getBaseURI();
43 if (XMLString::stringLen(publicId) > 0) {
44 return translateEnv(publicId, baseURI);
47 return translateEnv(systemId, baseURI);
50 InputSource* EResolver::translateEnv(
const XMLCh *
id,
const XMLCh * baseURI)
53 char* chId = XMLString::transcode(
id);
54 std::string *idStr =
new std::string(chId);
55 XMLString::release(&chId);
58 m_entities.push_back(idStr);
62 std::cout <<
"Bad entity name " << idStr << std::endl;
68 XMLCh* realName = XMLString::transcode(idStr->c_str());
72 LocalFileInputSource* src =
new LocalFileInputSource(baseURI, realName);
73 XMLString::release(&realName);
79 for (
unsigned i = 0; i < m_entities.size(); i++) {
static int expandEnvVar(std::string *toExpand, const std::string &openDel=std::string("$("), const std::string &closeDel=std::string(")"))
virtual XERCES_CPP_NAMESPACE_QUALIFIER InputSource * resolveEntity(XERCES_CPP_NAMESPACE_QUALIFIER XMLResourceIdentifier *xmlRI)