From 5ca3d042326e50448a3f90cd3e29e174909cd8cd Mon Sep 17 00:00:00 2001 From: Adrian Kummerländer Date: Tue, 3 Jun 2014 19:00:53 +0200 Subject: Replaced XSLTInputSource with LocalFileInputSource in "read-xml-file" * removes xalan and boost::filesystem::fstream dependencies from FunctionReadXmlFile * xercesc provides a solution for loading files into it's XercesDOMParser class ** this should be used instead of building a custom replacement using boost's fstream and xalan::XSLTInputSource --- src/function/read_xml_file.cc | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'src/function') diff --git a/src/function/read_xml_file.cc b/src/function/read_xml_file.cc index 2fa4f13..cfa216c 100644 --- a/src/function/read_xml_file.cc +++ b/src/function/read_xml_file.cc @@ -1,28 +1,26 @@ #include "read_xml_file.h" -#include - #include #include #include #include - -#include "boost/filesystem/fstream.hpp" +#include #include "support/xerces_string_guard.h" #include "support/dom/result_node_facade.h" namespace { -using InputXSLT::XercesStringGuard; - inline xercesc::DOMNode* importDocumentElement( - const boost::filesystem::path& filePath, + const std::string& filePath, xercesc::DOMDocument* const domDocument ) { + const xercesc::LocalFileInputSource file( + *InputXSLT::XercesStringGuard(filePath.data()) + ); + xercesc::XercesDOMParser parser; - boost::filesystem::ifstream file(filePath); - parser.parse(xalan::XSLTInputSource(file)); + parser.parse(file); return domDocument->importNode( parser.getDocument()->getDocumentElement(), @@ -67,7 +65,7 @@ xercesc::DOMDocument* FunctionReadXmlFile::constructDocument( result.setAttribute("result", "success"); result.setContent( - importDocumentElement(filePath, domDocument) + importDocumentElement(filePath.string(), domDocument) ); } else { result.setAttribute("result", "error"); -- cgit v1.2.3