aboutsummaryrefslogtreecommitdiff
path: root/src/function/transform.cc
diff options
context:
space:
mode:
authorAdrian Kummerlaender2014-06-26 20:26:32 +0200
committerAdrian Kummerlaender2014-06-26 20:26:32 +0200
commit266b408ee53b9bc7db2b1a5c92e62adfd2af6def (patch)
treeb84551406742ba892824a5770ae8fb8ec3a6a510 /src/function/transform.cc
parent7b872121000d4db4026d0c90fcb95a10f1e43694 (diff)
downloadInputXSLT-266b408ee53b9bc7db2b1a5c92e62adfd2af6def.tar
InputXSLT-266b408ee53b9bc7db2b1a5c92e62adfd2af6def.tar.gz
InputXSLT-266b408ee53b9bc7db2b1a5c92e62adfd2af6def.tar.bz2
InputXSLT-266b408ee53b9bc7db2b1a5c92e62adfd2af6def.tar.lz
InputXSLT-266b408ee53b9bc7db2b1a5c92e62adfd2af6def.tar.xz
InputXSLT-266b408ee53b9bc7db2b1a5c92e62adfd2af6def.tar.zst
InputXSLT-266b408ee53b9bc7db2b1a5c92e62adfd2af6def.zip
Implemented basic external "write-file" function
* accepts a path parameter and the content to be written * removed target parameter form FunctionTransform ** transformation result is now returned as a string *** nodeset return value is planned ** e.g. writing the result to the fs is optional and has to be achieved using FunctionWriteFile * changed "transform" test case accordingly * this marks a paradigm shift and is the continuation of the changes described in 741a70f ** InputXSLT now also implements a output function * added basic io error handling to FunctionReadFile
Diffstat (limited to 'src/function/transform.cc')
-rw-r--r--src/function/transform.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/function/transform.cc b/src/function/transform.cc
index 3ab6475..9cf806f 100644
--- a/src/function/transform.cc
+++ b/src/function/transform.cc
@@ -4,6 +4,8 @@
#include <xercesc/dom/DOMImplementation.hpp>
#include <xercesc/dom/DOMElement.hpp>
+#include <sstream>
+
#include "transformation_facade.h"
#include "support/xerces_string_guard.h"
#include "support/dom/result_node_facade.h"
@@ -30,7 +32,6 @@ namespace InputXSLT {
xercesc::DOMDocument* FunctionTransform::constructDocument(
xalan::XSLTInputSource transformationSource,
- boost::filesystem::path targetPath,
xalan::XObjectPtr parameterObject
) {
xercesc::DOMDocument* const domDocument(
@@ -47,22 +48,23 @@ xercesc::DOMDocument* FunctionTransform::constructDocument(
ResultNodeFacade result(domDocument, rootNode, "transformation");
- result.setAttribute(
- "target",
- targetPath.filename().string()
- );
-
if ( auto transformation = TransformationFacade::try_create(
handleErrors(result),
transformationSource,
this->include_resolver_
) ) {
try {
+ std::stringstream targetStream;
+
transformation->generate(
- targetPath.string(),
+ targetStream,
parameterObject
);
+ result.setContent(
+ targetStream.str()
+ );
+
result.setAttribute("result", "success");
}
catch (const ErrorCapacitor::exception& exception) {