1 #ifndef XML_SCHEMA_RESOLVER_TPP
2 #define XML_SCHEMA_RESOLVER_TPP
4 #include "XML_Schema_Resolver.h"
5 #include "XercesString.h"
7 #include <xercesc/framework/LocalFileInputSource.hpp>
8 #include <xercesc/framework/Wrapper4InputSource.hpp>
10 using xercesc::Wrapper4InputSource;
11 using xercesc::LocalFileInputSource;
16 template<typename Resolver>
17 XML_Schema_Resolver<Resolver>::XML_Schema_Resolver (void)
22 template<typename Resolver>
23 XML_Schema_Resolver<Resolver>::XML_Schema_Resolver (Resolver &res)
28 template<typename Resolver>
30 XML_Schema_Resolver<Resolver>::get_resolver (void)
35 /// This function is called by the Xerces infrastructure to
36 /// actually resolve the location of a schema.
37 template<typename Resolver>
39 XML_Schema_Resolver<Resolver>::resolveEntity (const XMLCh *const publicId,
40 const XMLCh *const systemId)
42 XStr path = resolver_ (publicId, systemId);
43 if (path.begin () == 0)
46 // Ownership of these objects is given to other people.
47 return /*new Wrapper4InputSource*/ (new LocalFileInputSource (path.begin ()));
51 #endif /*XML_SCHEMA_RESOLVER_TPP*/