aboutsummaryrefslogtreecommitdiff
path: root/src/function
diff options
context:
space:
mode:
Diffstat (limited to 'src/function')
-rw-r--r--src/function/read_file.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/function/read_file.cc b/src/function/read_file.cc
index dcbff25..ea7a758 100644
--- a/src/function/read_file.cc
+++ b/src/function/read_file.cc
@@ -1,6 +1,6 @@
#include "read_file.h"
-#include "utility.h"
+#include <fstream>
namespace InputXSLT {
@@ -33,10 +33,15 @@ xalan::XObjectPtr FunctionReadFile::execute(
fileName.end()
);
+ std::ifstream file(fileName);
+
+ std::string content(
+ (std::istreambuf_iterator<char>(file)),
+ (std::istreambuf_iterator<char>())
+ );
+
return executionContext.getXObjectFactory().createString(
- xalan::XalanDOMString(
- InputXSLT::readFile(fileName).data()
- )
+ xalan::XalanDOMString(content.data())
);
}