aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerländer2014-06-03 19:00:53 +0200
committerAdrian Kummerländer2014-06-03 19:00:53 +0200
commit5ca3d042326e50448a3f90cd3e29e174909cd8cd (patch)
tree61300aa823b38976df859c409bfe69688bcc87b8
parent533ebc587ee2b4e8e3c77b8ecd10056670483754 (diff)
downloadInputXSLT-5ca3d042326e50448a3f90cd3e29e174909cd8cd.tar
InputXSLT-5ca3d042326e50448a3f90cd3e29e174909cd8cd.tar.gz
InputXSLT-5ca3d042326e50448a3f90cd3e29e174909cd8cd.tar.bz2
InputXSLT-5ca3d042326e50448a3f90cd3e29e174909cd8cd.tar.lz
InputXSLT-5ca3d042326e50448a3f90cd3e29e174909cd8cd.tar.xz
InputXSLT-5ca3d042326e50448a3f90cd3e29e174909cd8cd.tar.zst
InputXSLT-5ca3d042326e50448a3f90cd3e29e174909cd8cd.zip
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
-rw-r--r--src/function/read_xml_file.cc18
1 files changed, 8 insertions, 10 deletions
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 <xalanc/XSLT/XSLTInputSource.hpp>
-
#include <xercesc/dom/DOMDocument.hpp>
#include <xercesc/dom/DOMImplementation.hpp>
#include <xercesc/dom/DOMElement.hpp>
#include <xercesc/parsers/XercesDOMParser.hpp>
-
-#include "boost/filesystem/fstream.hpp"
+#include <xercesc/framework/LocalFileInputSource.hpp>
#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<XMLCh>(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");