diff options
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; } |