aboutsummaryrefslogtreecommitdiff
path: root/src/function/read_xml_file.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/function/read_xml_file.cc')
-rw-r--r--src/function/read_xml_file.cc18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/function/read_xml_file.cc b/src/function/read_xml_file.cc
index 78f81c4..ac42288 100644
--- a/src/function/read_xml_file.cc
+++ b/src/function/read_xml_file.cc
@@ -4,12 +4,12 @@
namespace InputXSLT {
-FunctionReadXmlFile::FunctionReadXmlFile(const std::string& path):
- path_(path),
+FunctionReadXmlFile::FunctionReadXmlFile(const FilesystemContext& context):
+ fs_context_(context),
parser_() { }
FunctionReadXmlFile::FunctionReadXmlFile(const FunctionReadXmlFile& src):
- path_(src.path_),
+ fs_context_(src.fs_context_),
parser_() { }
xalan::XObjectPtr FunctionReadXmlFile::execute(
@@ -23,19 +23,13 @@ xalan::XObjectPtr FunctionReadXmlFile::execute(
executionContext
);
- generalError(executionContext, context, locator);
+ this->generalError(executionContext, context, locator);
}
- xalan::CharVectorType castHelper;
- arguments[0]->str().transcode(castHelper);
-
- const std::string fileName(
- castHelper.begin(),
- castHelper.end()
+ boost::filesystem::ifstream file(
+ this->fs_context_.resolve(arguments[0]->str())
);
- boost::filesystem::ifstream file(this->path_ / fileName);
-
return executionContext.getXObjectFactory().createNodeSet(
this->parser_.parseXMLStream(
xalan::XSLTInputSource(file)