From fcc2f8ee41d6793411a2321e6b0ac46cb5ba23ee Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Tue, 8 Jul 2014 15:05:25 +0200 Subject: Fixed entity resolution bug concerning non-include paths * paths that can not be resolved against the include-path vector were passed on as they were instead of first removing the "file://" prefix * this caused all normal entity paths passed to "xsl:import" and "xsl:include" statements to be unresolvable --- src/support/include_entity_resolver.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/support/include_entity_resolver.cc b/src/support/include_entity_resolver.cc index 07577c1..818d307 100644 --- a/src/support/include_entity_resolver.cc +++ b/src/support/include_entity_resolver.cc @@ -30,6 +30,10 @@ boost::optional extractFilePath( } } +inline const XMLCh* shiftSystemIdPastPrefix(const XMLCh* const systemId) { + return systemId + 7; +} + } namespace InputXSLT { @@ -37,7 +41,9 @@ namespace InputXSLT { boost::filesystem::path IncludeEntityResolver::getPathFromSystemId( const XMLCh* const systemId) { return boost::filesystem::path( - *XercesStringGuard(systemId) + 7 + *XercesStringGuard( + shiftSystemIdPastPrefix(systemId) + ) ); } @@ -60,7 +66,7 @@ xercesc::InputSource* IncludeEntityResolver::resolveEntity( ); } else { return new xercesc::LocalFileInputSource( - *XercesStringGuard(systemIdString) + shiftSystemIdPastPrefix(systemId) ); } } else { -- cgit v1.2.3