diff options
author | Adrian Kummerländer | 2014-04-20 13:09:32 +0200 |
---|---|---|
committer | Adrian Kummerländer | 2014-04-20 13:09:32 +0200 |
commit | 29a9fb20b4c8414f2590886e43ae86794a53db89 (patch) | |
tree | 4d426d45293a019caee8ee879186111c90b426d3 /src/function/read_xml_file.cc | |
parent | 3383e24e396431eed7d4ab9f69ff8ffaf12d4925 (diff) | |
download | InputXSLT-29a9fb20b4c8414f2590886e43ae86794a53db89.tar InputXSLT-29a9fb20b4c8414f2590886e43ae86794a53db89.tar.gz InputXSLT-29a9fb20b4c8414f2590886e43ae86794a53db89.tar.bz2 InputXSLT-29a9fb20b4c8414f2590886e43ae86794a53db89.tar.lz InputXSLT-29a9fb20b4c8414f2590886e43ae86794a53db89.tar.xz InputXSLT-29a9fb20b4c8414f2590886e43ae86794a53db89.tar.zst InputXSLT-29a9fb20b4c8414f2590886e43ae86794a53db89.zip |
Implemented support for modifying external function base path
* one expects a read-file function to work relative to the directory the transformation is located and not to the executable's location
** from the perspective of the user the transformation is the application, not the actual executable
* removed PlattformGuard struct from TransformerGuard (now TransformerFacade)
* TransformerFacade is instatiated with the appropriate relative working path
** i.e. it will have to be instantiated for every directory containing one or more transformations
Diffstat (limited to 'src/function/read_xml_file.cc')
-rw-r--r-- | src/function/read_xml_file.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/function/read_xml_file.cc b/src/function/read_xml_file.cc index 616d189..be091a0 100644 --- a/src/function/read_xml_file.cc +++ b/src/function/read_xml_file.cc @@ -2,10 +2,12 @@ namespace InputXSLT { -FunctionReadXmlFile::FunctionReadXmlFile(): +FunctionReadXmlFile::FunctionReadXmlFile(const std::string& path): + path_(path), parser_() { } -FunctionReadXmlFile::FunctionReadXmlFile(const FunctionReadXmlFile&): +FunctionReadXmlFile::FunctionReadXmlFile(const FunctionReadXmlFile& src): + path_(src.path_), parser_() { } xalan::XObjectPtr FunctionReadXmlFile::execute( @@ -22,9 +24,12 @@ xalan::XObjectPtr FunctionReadXmlFile::execute( generalError(executionContext, context, locator); } + xalan::XalanDOMString fileName(this->path_.data()); + fileName.append(arguments[0]->str()); + return executionContext.getXObjectFactory().createNodeSet( this->parser_.parseXMLStream( - xalan::XSLTInputSource(arguments[0]->str()) + xalan::XSLTInputSource(fileName) ) ); } |