Skip to content

Instantly share code, notes, and snippets.

@andrewminton
Created June 30, 2012 20:50
Show Gist options
  • Save andrewminton/3025456 to your computer and use it in GitHub Desktop.
Save andrewminton/3025456 to your computer and use it in GitHub Desktop.
<data>
<copyright><p>Copyright (C) <root/> <thisyear/></p></copyright>
</data>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" indent="yes" />
<xsl:template match="/">
<xsl:apply-templates select="data/copyright" mode="html" disable-output-escaping='yes'/>
</xsl:template>
<xsl:template match="*" mode="html">
<xsl:element name="{name()}">
<xsl:apply-templates select="* | @* | text()" mode="html"/>
</xsl:element>
</xsl:template>
<xsl:template match="@*" mode="html">
<xsl:attribute name="{name()}">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:template>
<xsl:template match="root" priority="1" mode="html">
<xsl:text>My Website root URL</xsl:text>
</xsl:template>
<xsl:template match="thisyear" priority="1" mode="html">
<xsl:text>2012 or date from Symphony Params</xsl:text>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment