diff options
author | Adrian Kummerländer | 2014-05-12 18:49:24 +0200 |
---|---|---|
committer | Adrian Kummerländer | 2014-05-12 18:49:24 +0200 |
commit | c4fcfa9b39d9c29ecbc3ac1c12b7e5b2beb24a6d (patch) | |
tree | d76ed8e9934ac6b79aabf76a7f401cfa72d37f7b /test/transform | |
parent | 20fca5978b55606062cdaf4c94dec82f5318a62a (diff) | |
download | InputXSLT-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 'test/transform')
-rw-r--r-- | test/transform/reference.xml | 35 | ||||
-rw-r--r-- | test/transform/test.xsl | 24 | ||||
-rw-r--r-- | test/transform/transformation.xsl | 31 |
3 files changed, 90 insertions, 0 deletions
diff --git a/test/transform/reference.xml b/test/transform/reference.xml new file mode 100644 index 0000000..37c060e --- /dev/null +++ b/test/transform/reference.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<test_case> +<transform><?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet + version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:InputXSLT="function.inputxslt.application" + exclude-result-prefixes="InputXSLT" +> + +<xsl:output + method="xml" + omit-xml-declaration="no" + encoding="UTF-8" + indent="yes" +/> + +<xsl:template match="/"> +<test_case> + <transform> + <xsl:variable + name = "result" + select = "InputXSLT:transform('test.xsl', 'test_actual.xml')" + /> + + <xsl:value-of select=" + InputXSLT:read-xml-file('test_actual.xml')/test_case/transform_test + "/> + </transform> +</test_case> +</xsl:template> + +</xsl:stylesheet> +</transform> +</test_case> diff --git a/test/transform/test.xsl b/test/transform/test.xsl new file mode 100644 index 0000000..40134c4 --- /dev/null +++ b/test/transform/test.xsl @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet + version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:InputXSLT="function.inputxslt.application" + exclude-result-prefixes="InputXSLT" +> + +<xsl:output + method="xml" + omit-xml-declaration="no" + encoding="UTF-8" + indent="yes" +/> + +<xsl:template match="/"> +<test_case> + <transform_test> + <xsl:value-of select="InputXSLT:read-file('transformation.xsl')"/> + </transform_test> +</test_case> +</xsl:template> + +</xsl:stylesheet> diff --git a/test/transform/transformation.xsl b/test/transform/transformation.xsl new file mode 100644 index 0000000..9039642 --- /dev/null +++ b/test/transform/transformation.xsl @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet + version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:InputXSLT="function.inputxslt.application" + exclude-result-prefixes="InputXSLT" +> + +<xsl:output + method="xml" + omit-xml-declaration="no" + encoding="UTF-8" + indent="yes" +/> + +<xsl:template match="/"> +<test_case> + <transform> + <xsl:variable + name = "result" + select = "InputXSLT:transform('test.xsl', 'test_actual.xml')" + /> + + <xsl:value-of select=" + InputXSLT:read-xml-file('test_actual.xml')/test_case/transform_test + "/> + </transform> +</test_case> +</xsl:template> + +</xsl:stylesheet> |