Skip to content

Instantly share code, notes, and snippets.

@dtan
Created January 28, 2010 16:09
Show Gist options
  • Save dtan/288871 to your computer and use it in GitHub Desktop.
Save dtan/288871 to your computer and use it in GitHub Desktop.
<xsl:template match="body//*">
<xsl:element name="{name()}">
<xsl:apply-templates select="* | @* | text()"/>
</xsl:element>
</xsl:template>
<xsl:template match="body//@*">
<xsl:attribute name="{name(.)}">
<xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
</xsl:attribute>
</xsl:template>
<!-- from niels : http://symphony-cms.com/get-involved/member/Nils/ -->
<xsl:template match="@src" priority="1">
<xsl:attribute name="src">
<!-- of course better to make the /image/2/450/300/1 dynamically generated! -->
<xsl:value-of select="concat($root, '/image/2/450/300/1', substring-after(., $workspace))"/>
</xsl:attribute>
</xsl:template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment