diff options
author | Adrian Kummerländer | 2014-04-19 18:31:15 +0200 |
---|---|---|
committer | Adrian Kummerländer | 2014-04-19 18:31:15 +0200 |
commit | 3383e24e396431eed7d4ab9f69ff8ffaf12d4925 (patch) | |
tree | 8cedb029eee462dd8145077aee98db593ef6d62d /test.cc | |
parent | 334efe3383c436d61a8e5dd95b923cb0d5db9652 (diff) | |
download | InputXSLT-3383e24e396431eed7d4ab9f69ff8ffaf12d4925.tar InputXSLT-3383e24e396431eed7d4ab9f69ff8ffaf12d4925.tar.gz InputXSLT-3383e24e396431eed7d4ab9f69ff8ffaf12d4925.tar.bz2 InputXSLT-3383e24e396431eed7d4ab9f69ff8ffaf12d4925.tar.lz InputXSLT-3383e24e396431eed7d4ab9f69ff8ffaf12d4925.tar.xz InputXSLT-3383e24e396431eed7d4ab9f69ff8ffaf12d4925.tar.zst InputXSLT-3383e24e396431eed7d4ab9f69ff8ffaf12d4925.zip |
Implemented transformation execution function
* InputXSLT::PlattformGuard handles xerces and xalan construction and lifetime
* InputXSLT::TransformerGuard instantiates PlattformGuard, configurates external functions
** offers execute method for "executing" a XSL tranformation with empty input
Diffstat (limited to 'test.cc')
-rw-r--r-- | test.cc | 44 |
1 files changed, 5 insertions, 39 deletions
@@ -1,44 +1,10 @@ -#include <xalanc/Include/PlatformDefinitions.hpp> -#include <xercesc/util/PlatformUtils.hpp> -#include <xalanc/XalanTransformer/XalanTransformer.hpp> -#include <xalanc/XSLT/XSLTInputSource.hpp> - -#include "function/read_file.h" -#include "function/read_xml_file.h" +#include "transformer_guard.h" int main() { - xercesc::XMLPlatformUtils::Initialize(); - xalan::XalanTransformer::initialize(); - - const xalan::XalanDOMString customNamespace( - "http://ExternalFunction.xalan-c++.xml.apache.org" - ); - - xalan::XalanTransformer transformer; - - transformer.installExternalFunction( - customNamespace, - xalan::XalanDOMString("read-file"), - InputXSLT::FunctionReadFile() - ); + InputXSLT::TransformerGuard guard; - transformer.installExternalFunction( - customNamespace, - xalan::XalanDOMString("read-xml-file"), - InputXSLT::FunctionReadXmlFile() + return guard.execute( + "../dummy/transform.xsl", + "out.xml" ); - - xalan::XSLTInputSource input("../dummy/in.xml"); - xalan::XSLTInputSource tranformation("../dummy/transform.xsl"); - xalan::XSLTResultTarget output("out.xml"); - - int result(transformer.transform( - input, - tranformation, - output - )); - - xalan::XalanTransformer::terminate(); - - return result; } |