diff options
author | Adrian Kummerländer | 2014-04-17 21:51:20 +0200 |
---|---|---|
committer | Adrian Kummerländer | 2014-04-17 21:51:20 +0200 |
commit | 9648c804a23278fcdf66e0f78c350e2ddce492ee (patch) | |
tree | 3da73f21148ffaa3773abf5cd7a0d35cba76f8e5 /dummy | |
download | InputXSLT-9648c804a23278fcdf66e0f78c350e2ddce492ee.tar InputXSLT-9648c804a23278fcdf66e0f78c350e2ddce492ee.tar.gz InputXSLT-9648c804a23278fcdf66e0f78c350e2ddce492ee.tar.bz2 InputXSLT-9648c804a23278fcdf66e0f78c350e2ddce492ee.tar.lz InputXSLT-9648c804a23278fcdf66e0f78c350e2ddce492ee.tar.xz InputXSLT-9648c804a23278fcdf66e0f78c350e2ddce492ee.tar.zst InputXSLT-9648c804a23278fcdf66e0f78c350e2ddce492ee.zip |
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
Diffstat (limited to 'dummy')
-rw-r--r-- | dummy/in.xml | 7 | ||||
-rw-r--r-- | dummy/test.txt | 1 | ||||
-rw-r--r-- | dummy/transform.xsl | 31 |
3 files changed, 39 insertions, 0 deletions
diff --git a/dummy/in.xml b/dummy/in.xml new file mode 100644 index 0000000..7b512bc --- /dev/null +++ b/dummy/in.xml @@ -0,0 +1,7 @@ +<?xml version="1.0"?> +<items> + <item>Test1</item> + <item>Test2</item> + <item>Test3</item> + <item>Test4</item> +</items> diff --git a/dummy/test.txt b/dummy/test.txt new file mode 100644 index 0000000..cd08755 --- /dev/null +++ b/dummy/test.txt @@ -0,0 +1 @@ +Hello world! diff --git a/dummy/transform.xsl b/dummy/transform.xsl new file mode 100644 index 0000000..dca15a1 --- /dev/null +++ b/dummy/transform.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:external="http://ExternalFunction.xalan-c++.xml.apache.org"> + +<xsl:output method="xml" + doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" + doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" + omit-xml-declaration="yes" + encoding="UTF-8" + indent="yes" /> + +<xsl:template match="/"> +<html> + <head> + </head> + <body> + <xsl:apply-templates select="items/item" /> + </body> +</html> +</xsl:template> + +<xsl:template match="items/item"> + <div id="{.}"> + <xsl:value-of select="external:read-file('dummy/test.txt')" /> + </div> +</xsl:template> + +</xsl:stylesheet> + + |