aboutsummaryrefslogtreecommitdiff
path: root/src/function
diff options
context:
space:
mode:
authorAdrian Kummerlaender2014-07-04 22:41:17 +0200
committerAdrian Kummerlaender2014-07-04 22:41:17 +0200
commitf05e742b88e3ebf7401c252332022f1a2f7eb8b0 (patch)
tree038e011e808eb86e4c8ebfee11132e5c952edaf0 /src/function
parent784ac42a0f05608e3d9c5e15246dbf76ce9e3d51 (diff)
downloadInputXSLT-f05e742b88e3ebf7401c252332022f1a2f7eb8b0.tar
InputXSLT-f05e742b88e3ebf7401c252332022f1a2f7eb8b0.tar.gz
InputXSLT-f05e742b88e3ebf7401c252332022f1a2f7eb8b0.tar.bz2
InputXSLT-f05e742b88e3ebf7401c252332022f1a2f7eb8b0.tar.lz
InputXSLT-f05e742b88e3ebf7401c252332022f1a2f7eb8b0.tar.xz
InputXSLT-f05e742b88e3ebf7401c252332022f1a2f7eb8b0.tar.zst
InputXSLT-f05e742b88e3ebf7401c252332022f1a2f7eb8b0.zip
Changed FunctionTransform result type to node-set
* using xalan::FormatterToXercesDOM internally ** this required changes to the TransformationFacade::generate member method overloads * TransformationFacade::generate now accepts references to xalan::FormatterListener instances ** "generate(std::basic_ostream<char>&..." instantiates a xalan::FormatterToXML and passes it to the actual generate member method * changed ResultNodeFacade's "getNode" method into a "getResultElement" method ** xalan::FormatterToXercesDOM requires a xercesc::DOMElement instance instead of the previously available xercesc::DOMNode instance ** changed FunctionReadDirectory accordingly * adapted FunctionTransform test case accordingly
Diffstat (limited to 'src/function')
-rw-r--r--src/function/read_directory.cc2
-rw-r--r--src/function/transform.cc19
2 files changed, 10 insertions, 11 deletions
diff --git a/src/function/read_directory.cc b/src/function/read_directory.cc
index 884963e..d5357e8 100644
--- a/src/function/read_directory.cc
+++ b/src/function/read_directory.cc
@@ -29,7 +29,7 @@ xercesc::DOMDocument* FunctionReadDirectory::constructDocument(
if ( boost::filesystem::is_directory(directoryPath) ) {
result.setAttribute("result", "success");
- xercesc::DOMNode* const resultNode = result.getNode();
+ xercesc::DOMNode* const resultNode = result.getResultElement();
FilesystemContext::iterate(
directoryPath,
diff --git a/src/function/transform.cc b/src/function/transform.cc
index bc71125..1d22399 100644
--- a/src/function/transform.cc
+++ b/src/function/transform.cc
@@ -1,11 +1,11 @@
#include "transform.h"
+#include <xalanc/XercesParserLiaison/FormatterToXercesDOM.hpp>
+
#include <xercesc/dom/DOMDocument.hpp>
#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"
@@ -43,11 +43,11 @@ xercesc::DOMDocument* FunctionTransform::constructDocument(
)
);
- xercesc::DOMNode* const rootNode(
+ xercesc::DOMElement* const rootElement(
domDocument->getDocumentElement()
);
- ResultNodeFacade result(domDocument, rootNode, "transformation");
+ ResultNodeFacade result(domDocument, rootElement, "transformation");
if ( auto transformation = TransformationFacade::try_create(
handleErrors(result),
@@ -56,17 +56,16 @@ xercesc::DOMDocument* FunctionTransform::constructDocument(
this->include_resolver_
) ) {
try {
- std::stringstream targetStream;
+ xalan::FormatterToXercesDOM formatter(
+ domDocument,
+ result.getResultElement()
+ );
transformation->generate(
- targetStream,
+ formatter,
parameterObject
);
- result.setContent(
- targetStream.str()
- );
-
result.setAttribute("result", "success");
}
catch (const ErrorCapacitor::exception& exception) {