This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Jeni reminds me.....


>  It seems you want to launch an obfuscated XSLT contest... ;-)
> 
> http://www.dpawson.co.uk/xsl/sect2/N3773.html
> 
> Any more ;-)
> 

I can't remember where i found this one, but it's kinda fun:

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:output indent="yes"/>
<xsl:variable
name="abc">ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz</xsl:variabl
e>
<xsl:variable
name="rot13">NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm</xsl:varia
ble>
<xsl:template match="*">
   <xsl:element name="{translate(name(),$abc,$rot13)}">
      <xsl:for-each select="@*">
         <xsl:attribute name="{translate(name(),$abc,$rot13)}">
		<xsl:value-of select="translate(.,$abc,$rot13)"/>
	  </xsl:attribute>
      </xsl:for-each>
	<xsl:for-each select="text()">
	<xsl:value-of select="translate(.,$abc,$rot13)"/>
	</xsl:for-each>
	<xsl:apply-templates select="*"/>
  </xsl:element>
</xsl:template>
</xsl:stylesheet>

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]