1 #include "XML_Schema_Resolver.h"
3 #include <xercesc/util/PlatformUtils.hpp>
4 #include <xercesc/util/XercesDefs.hpp>
6 #include "XercesString.h"
8 #include "ace/Env_Value_T.h"
9 #include "ace/SString.h"
15 Basic_Resolver::Basic_Resolver (const ACE_TCHAR
*path
)
21 Basic_Resolver::operator() (const XMLCh
*const,
22 const XMLCh
*const systemId
) const
25 path
.append (systemId
);
26 return path
.release ();
29 Environment_Resolver::Environment_Resolver (const ACE_TCHAR
*variable
,
30 const ACE_TCHAR
*relpath
)
32 this->add_path (variable
, relpath
);
35 using xercesc::XMLPlatformUtils
;
38 Environment_Resolver::add_path (const ACE_TCHAR
*variable
,
39 const ACE_TCHAR
*relpath
)
41 ACE_Env_Value
<ACE_TString
> path_env (variable
,
44 XStr
xpath (static_cast<ACE_TString
>(path_env
).c_str());
45 XStr
xrelpath (relpath
);
47 xpath
.append (xrelpath
);
49 paths_
.push_back (xpath
);
53 Environment_Resolver::operator() (const XMLCh
*const,
54 const XMLCh
*const systemId
) const
56 for (std::vector
<XStr
>::const_iterator i
= this->paths_
.begin ();
57 i
!= this->paths_
.end ();
61 path
.append(systemId
);
63 FileHandle
file (XMLPlatformUtils::openFile (path
));
67 XMLPlatformUtils::closeFile (file
);
68 return path
.release ();