commit 2fc3c7a5a22610d685da513227c126afcb382070 parent 9ffeca9995367aedafd64981ee3e3b4caa87cd9c Author: Sam Kingston <sam@sjkwi.com.au> Date: Sun, 10 Oct 2010 20:15:22 +1000 sample xslt stylesheet Diffstat:
| A | sample.xsl | | | 59 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1 file changed, 59 insertions(+), 0 deletions(-)
diff --git a/sample.xsl b/sample.xsl
@@ -0,0 +1,59 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:html="http://www.w3.org/1999/xhtml"
+ xmlns:constance="http://code.djc.id.au/constance/xmlns/"
+ version="1.0"
+ extension-element-prefixes="constance">
+<xsl:output method="xml" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" />
+
+<!-- identity -->
+<xsl:template match="@*|node()">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|node()" />
+ </xsl:copy>
+</xsl:template>
+
+<xsl:template match="html:head">
+ <head profile="http://gmpg.org/xfn/11">
+ <xsl:for-each select="@*">
+ <xsl:attribute name="{name(.)}">
+ <xsl:value-of select="." />
+ </xsl:attribute>
+ </xsl:for-each>
+ <xsl:choose>
+ <xsl:when test="html:title">
+ <title><xsl:value-of select="html:title" /> - SITE</title>
+ </xsl:when>
+ <xsl:otherwise>
+ <title>SITE</title>
+ </xsl:otherwise>
+ </xsl:choose>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+ <meta name="generator" content="constance" />
+ <meta name="DC.creator" content="Joe Bloggs" />
+ <link rel="stylesheet" type="text/css" href="/style/common.css" />
+ <xsl:apply-templates select="*[name() != 'title']" />
+ </head>
+</xsl:template>
+
+<xsl:template match="html:body">
+ <body>
+ <xsl:for-each select="@*">
+ <xsl:attribute name="{name(.)}">
+ <xsl:value-of select="." />
+ </xsl:attribute>
+ </xsl:for-each>
+ <div id="contentwrapper">
+ <div id="sidebar">
+ </div>
+ <div id="content">
+ <xsl:apply-templates select="*" />
+ </div>
+ <div id="footer">
+ Generated by <a href="http://bitbucket.org/sjkingo/constance-sam">constance</a>.
+ </div>
+ </div>
+ </body>
+</xsl:template>
+
+</xsl:stylesheet>