aboutsummaryrefslogtreecommitdiff
path: root/src/function/transform.h
diff options
context:
space:
mode:
authorAdrian Kummerländer2014-05-12 18:49:24 +0200
committerAdrian Kummerländer2014-05-12 18:49:24 +0200
commitc4fcfa9b39d9c29ecbc3ac1c12b7e5b2beb24a6d (patch)
treed76ed8e9934ac6b79aabf76a7f401cfa72d37f7b /src/function/transform.h
parent20fca5978b55606062cdaf4c94dec82f5318a62a (diff)
downloadInputXSLT-c4fcfa9b39d9c29ecbc3ac1c12b7e5b2beb24a6d.tar
InputXSLT-c4fcfa9b39d9c29ecbc3ac1c12b7e5b2beb24a6d.tar.gz
InputXSLT-c4fcfa9b39d9c29ecbc3ac1c12b7e5b2beb24a6d.tar.bz2
InputXSLT-c4fcfa9b39d9c29ecbc3ac1c12b7e5b2beb24a6d.tar.lz
InputXSLT-c4fcfa9b39d9c29ecbc3ac1c12b7e5b2beb24a6d.tar.xz
InputXSLT-c4fcfa9b39d9c29ecbc3ac1c12b7e5b2beb24a6d.tar.zst
InputXSLT-c4fcfa9b39d9c29ecbc3ac1c12b7e5b2beb24a6d.zip
Implemented basic external transform function
* "InputXSLT:transform" expects two input arguments and executes the given transformation into the given target file ** this function respresents a important step in the direction of making it possible to write an actual static site generator on top of InputXSLT using XSLT * added basic "transform" test case * updated README.md to include this new function
Diffstat (limited to 'src/function/transform.h')
-rw-r--r--src/function/transform.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/function/transform.h b/src/function/transform.h
new file mode 100644
index 0000000..41bba05
--- /dev/null
+++ b/src/function/transform.h
@@ -0,0 +1,43 @@
+#ifndef INPUTXSLT_SRC_FUNCTION_TRANSFORM_H_
+#define INPUTXSLT_SRC_FUNCTION_TRANSFORM_H_
+
+#include <xalanc/XalanTransformer/XalanTransformer.hpp>
+#include <xalanc/XPath/XObjectFactory.hpp>
+#include <xalanc/XPath/Function.hpp>
+#include <xalanc/XPath/XObject.hpp>
+
+#include <memory>
+
+#include "common.h"
+#include "support/dom/document_cache.h"
+#include "support/filesystem_context.h"
+
+namespace InputXSLT {
+
+class FunctionTransform : public xalan::Function {
+ public:
+ FunctionTransform();
+
+ virtual xalan::XObjectPtr execute(
+ xalan::XPathExecutionContext&,
+ xalan::XalanNode*,
+ const xalan::XObjectPtr,
+ const xalan::XObjectPtr,
+ const xalan::Locator*
+ ) const;
+
+ virtual FunctionTransform* clone(xalan::MemoryManager&) const;
+
+ FunctionTransform& operator=(const FunctionTransform&) = delete;
+ bool operator==(const FunctionTransform&) const = delete;
+
+ private:
+ std::shared_ptr<DomDocumentCache> document_cache_;
+
+ const xalan::XalanDOMString& getError(xalan::XalanDOMString&) const;
+
+};
+
+}
+
+#endif // INPUTXSLT_SRC_FUNCTION_TRANSFORM_H_