February 20, 2008

Obfuscating XSLT

Inspired by ioccc.org, just for fun, really. Can you figure out what this stylesheet outputs (without running it of course)? <!DOCTYPE p [ <!ENTITY _0_ 'string'> <!ENTITY _0-0_ 'sub&_0_;'> ]> <p x:version="1.0" xmlns:x="http://www.w3.org/1999/XSL/Transform"> <x:variable name="_" select="document('')"/> <x:variable name="_-_" select="number(not(_-_=_-_=_-_=_-_))"/> <x:value-of select="concat( &_0-0_;(namespace-uri($_/*/*[$_-_]), $_-_, $_-_), &_0-0_;(name($_/*/*[$_-_]), &_0_;-length(*>*)*2, $_-_), &_0-0_;(@_>_-, &_0_;-length(******* div ...