From 9648c804a23278fcdf66e0f78c350e2ddce492ee Mon Sep 17 00:00:00 2001 From: Adrian Kummerländer Date: Thu, 17 Apr 2014 21:51:20 +0200 Subject: First commit of _InputXSLT_ * quick and dirty proof-of-concept for adding plain-file access to XSLT ** based on Apache Xalan XSLT processor * The idea is to create something like a static counterpart to Symphony CMS * Adding functions to XSLT for file system, plain file and binary file (read)-access * This project aims to test how such functionality can be integrated into XSLT ** if it works it could be developed into a nice static content transformation system * Contrary to the popular opinion I actually like XML and XSLT when used responsibly --- test.cc | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 test.cc (limited to 'test.cc') diff --git a/test.cc b/test.cc new file mode 100644 index 0000000..c922abf --- /dev/null +++ b/test.cc @@ -0,0 +1,37 @@ +#include +#include +#include +#include + +#include "src/read_file_command.h" + +int main() { + xercesc::XMLPlatformUtils::Initialize(); + xalanc_1_11::XalanTransformer::initialize(); + + const xalanc_1_11::XalanDOMString customNamespace( + "http://ExternalFunction.xalan-c++.xml.apache.org" + ); + + xalanc_1_11::XalanTransformer transformer; + + transformer.installExternalFunction( + customNamespace, + xalanc_1_11::XalanDOMString("read-file"), + FunctionFileRead() + ); + + xalanc_1_11::XSLTInputSource input("dummy/in.xml"); + xalanc_1_11::XSLTInputSource tranformation("dummy/transform.xsl"); + xalanc_1_11::XSLTResultTarget output("dummy/out.xml"); + + int result(transformer.transform( + input, + tranformation, + output + )); + + xalanc_1_11::XalanTransformer::terminate(); + + return result; +} -- cgit v1.2.3