aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2014-07-16 20:56:36 +0200
committerAdrian Kummerlaender2014-07-16 20:56:36 +0200
commit56e46331c3cb503baa2d3f8004dc0725baf51a0a (patch)
tree542f79b8c9ec2f6045a9012e2b52226fd126b5c8
parenta37f56cf3d6391536840c4f9389977e247e6cfc8 (diff)
downloadblog.kummerlaender.eu-56e46331c3cb503baa2d3f8004dc0725baf51a0a.tar
blog.kummerlaender.eu-56e46331c3cb503baa2d3f8004dc0725baf51a0a.tar.gz
blog.kummerlaender.eu-56e46331c3cb503baa2d3f8004dc0725baf51a0a.tar.bz2
blog.kummerlaender.eu-56e46331c3cb503baa2d3f8004dc0725baf51a0a.tar.lz
blog.kummerlaender.eu-56e46331c3cb503baa2d3f8004dc0725baf51a0a.tar.xz
blog.kummerlaender.eu-56e46331c3cb503baa2d3f8004dc0725baf51a0a.tar.zst
blog.kummerlaender.eu-56e46331c3cb503baa2d3f8004dc0725baf51a0a.zip
Added datasource master template
* handles basic output structure * provides XSLT standard template "text()/@*" redefinition to prevent unwanted output of unmatched elements
-rw-r--r--template/datasource/pages.xsl16
-rw-r--r--utility/datasource.xsl25
2 files changed, 26 insertions, 15 deletions
diff --git a/template/datasource/pages.xsl b/template/datasource/pages.xsl
index 7de4b4b..c77513a 100644
--- a/template/datasource/pages.xsl
+++ b/template/datasource/pages.xsl
@@ -7,23 +7,9 @@
exclude-result-prefixes="xalan InputXSLT"
>
-<xsl:output
- method="xml"
- omit-xml-declaration="no"
- encoding="UTF-8"
- indent="yes"
-/>
-
+<xsl:include href="[utility/datasource.xsl]"/>
<xsl:include href="[utility/formatter.xsl]"/>
-<xsl:template match="data">
- <datasource>
- <xsl:apply-templates />
- </datasource>
-</xsl:template>
-
-<xsl:template match="text()|@*"/>
-
<xsl:template match="source/pages">
<pages>
<xsl:apply-templates select="./*"/>
diff --git a/utility/datasource.xsl b/utility/datasource.xsl
new file mode 100644
index 0000000..02b37d1
--- /dev/null
+++ b/utility/datasource.xsl
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet
+ version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:xalan="http://xml.apache.org/xalan"
+ xmlns:InputXSLT="function.inputxslt.application"
+ exclude-result-prefixes="xalan InputXSLT"
+>
+
+<xsl:output
+ method="xml"
+ omit-xml-declaration="no"
+ encoding="UTF-8"
+ indent="yes"
+/>
+
+<xsl:template match="data">
+ <datasource>
+ <xsl:apply-templates />
+ </datasource>
+</xsl:template>
+
+<xsl:template match="text()|@*"/>
+
+</xsl:stylesheet>