[z3-checkins] r10732 - z3/clarity/trunk/xslt

faassen at codespeak.net faassen at codespeak.net
Sat Apr 16 15:23:14 MEST 2005


Author: faassen
Date: Sat Apr 16 15:23:14 2005
New Revision: 10732

Added:
   z3/clarity/trunk/xslt/unescape.xsl
Log:
Imperfect XSLT template which unespaces any < and > it runs into.
This is probably useless, but it's a neat application of misusing
XSLT, so I thought I'd check it in.


Added: z3/clarity/trunk/xslt/unescape.xsl
==============================================================================
--- (empty file)
+++ z3/clarity/trunk/xslt/unescape.xsl	Sat Apr 16 15:23:14 2005
@@ -0,0 +1,17 @@
+<xsl:stylesheet
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    version="1.0" >
+  <xsl:output method="text" />
+  
+  <xsl:template match="/">
+    <xsl:apply-templates />
+  </xsl:template>
+
+  <xsl:template match="@*"><xsl:text> </xsl:text><xsl:value-of select="name()" />=&quot;<xsl:value-of select="." />&quot;</xsl:template>
+
+  <xsl:template match="*">&lt;<xsl:value-of select="name()" /><xsl:copy><xsl:apply-templates select="@*"/>&gt;<xsl:apply-templates /></xsl:copy>&lt;/<xsl:value-of select="name()" />&gt;</xsl:template>
+
+  <xsl:template match="comment()">&lt;!--<xsl:value-of select="."/>--&gt;</xsl:template>
+  
+  <xsl:template match="processing-instruction()">&lt;?<xsl:value-of select="name()" /><xsl:text> </xsl:text><xsl:value-of select="." />?&gt;</xsl:template>
+</xsl:stylesheet>
\ No newline at end of file


More information about the z3-checkins mailing list