User:Taneb/XSLT S and K

XSLT S and K is an attempt to demonstrate the Turing Completeness of XSLT (a language proposed by the W3C for transforming one XML document to another) by writing an S and K combinatory logic interpreter doohickey.

The combinator has to be in a certain format: this is the format for the identity function SKK: &lt;s&gt; And for a version of Iota's universal combinator s(s(skk)(ks))(kk): &lt;s&gt;&lt;s&gt;&lt;s&gt;   

This may or may not work. It is suspected that either it does only one pass, or it doesn't work at all.        <xsl:value-of select="."/> <xsl:copy-of select=".&#46;/*[3]"/> </xsl:element> </xsl:element> <xsl:for-each select="./*[position>3]"> <xsl:copy-of select="."/> </xsl:for-each> </xsl:template> <xsl:template match="//k/*[2]/.."> <xsl:copy-of select="./*[1]"/> <xsl:for-each select="./*[position>2"> <xsl:copy-of select="."/> </xsl:for-each> </xsl:template> <xsl:template match="/*[2]/.."> <xsl:element name="{./*[1]}"> <xsl:value-of select="."/> <xsl:copy-of select=".&#46;/*[2]"/> </xsl:element> </xsl:template> </xsl:transform> This does not work in Internet Explorer. If you really want to run it on IE, decrement numbers is square brackets.