R
roy axenov
Warning! Some lines in this post are longer than 78
characters.
It just struck me - JAXSLTH! I mean, why not? XSLT is a
powerful language, and while string processing is not its
strong suit, it has more than enough tricks up its sleeve.
'What a wonderful idea! And something to distract me from
those awful UMLs, too. No, seriously, I just gotta try it.
Who cares if it's useless? I might still learn a thing or
two while doing it.' I'm a really bright fella, you know.
Pointlessness never stopped me from finding a good reason
to write the specs tomorrow.
Anyway, writing a JAXSLTH is not much of problem:
<stylesheet xmlns="http://www.w3.org/1999/XSL/Transform" version="1.0">
<output method="text"/>
<template match="/">Just another XSLT hacker, </template>
</stylesheet>
....but that's not very interesting. Randalschwartzy, yes,
and that can't possibly be a bad thing, but still
uninspiring. Well, it also has the virtue of fitting in the
sig block nicely. And, unfortunately, it seems to be just
about the best that you *can* fit in the sig block.
Something like:
<stylesheet xmlns="http://www.w3.org/1999/XSL/Transform" version="1.0">
<output method="text"/><template match="/"><value-of select="translate(
'Heck twoksid XSLT stupid, ','Htwksiceupd','Janthesuckr')"/></template>
</stylesheet>
....is possible, but that's arguably a worse JAXSLTH than
the first one.
Anyway, unaware of that problem, I started trying. Pretty
soon I came up with the idea of using that otherwise
useless namespace URI as a base string to work with. Half
an hour later I came up with an even better idea of taking
a good look at the XSL FAQ. Turned out, using namespace URI
in obfuscated XSLT is a well-known trick. Oh well. I've no
idea why this was so disheartening: I almost literally
stumbled upon it, and I always knew there are quite a few
people that are smarter than I am. I should've been able to
add two and two toghether and realize this has already been
done before (not that realizations like that ever stopped
me from reinventing the wheel). Nevertheless, I decided I'd
better get some, uh, work done and fired up the umbrello.
After looking at it for two minutes straight with a
*really* dumb look on my face, I gave up and went back to
toying with XSLT.
Another half an hour later, when I was deep in thinking of
ways to obfuscate the data, I suddenly realized that the
stylesheet I was working on was getting really long. 'Not
much of a JAXSLTH, that', I told myself. After applying the
KISS principle I was left with a stylesheet that was still
about twice as long as I needed. I toyed with substring-foo
and decimal-format for a while, but that wasn't getting me
anywhere. At this point:
<stylesheet xmlns="http://www.w3.org/1999/XSL/Transform" version="1.0">
<output method="text"/><template match="*"><call-template
name="a"><with-param
name="a">0806320220303115020111162024252628200130133611160420</with-param>
</call-template></template><template name="a"><param name="a"/><if
test="$a">
<value-of
select="substring(translate(namespace-uri(document('')/*),'w/p91.3m',
'Ju, jeck'),substring($a,1,2),1)"/><call-template name="a"><with-param
name="a"
select="substring($a,3)"/></call-template></if></template></stylesheet>
....I decided to try something else (for relatively small
values of 'else').
Unfortunately, even after giving up that ugly long string
literal and applying a nice little transformation to the
namespace URI, I was still left with:
<stylesheet xmlns="http://www.w3.org/1999/XSL/Transform"
version="1.0"><output
method="text"/><template match="*"><param name="x"><call-template
name="a">
<with-param name="s"
select="namespace-uri(document('')/*)"/></call-template>
</param><value-of select="translate($x,'19o3g:/pwrfans.htm',
'r toet sahc hanJuk')"/>er, </template><template name="a"><param
name="s"/><if
test="$s"><value-of select="substring($s,1,1)"/><call-template
name="a">
<with-param name="s"
select="translate(substring($s,2),substring($s,1,1),'')"
/></call-template></if></template></stylesheet>
Not good enough. (Actually, it's worse than the previous
example.)
I tried various minor optimizations, but again, that wasn't
getting me anywhere.
I increased the value of 'else' a little. But still:
<stylesheet xmlns="http://www.w3.org/1999/XSL/Transform" version="1.0">
<output method="text"/><param name="JkXSLT"><apply-templates select=
"document (concat('',''))/*"/></param><template match="/" name="a">
<param
name="a">4622010281381716020705138148495051810738714705139281</param>
<if test="$a"><value-of
select="substring($JkXSLT,substring($a,1,2),1)"/>
<call-template name="a"><with-param name="a" select="substring($a,3)"/>
</call-template></if></template><template match="*|@*"><value-of
select=
"name()"/><if test="not(node())"><value-of select="string()"/></if>
<apply-templates select="*|@*"/></template></stylesheet>
Way too long.
I decided to try something simpler and more elegant, and:
select="substring($a,$b,1)"/><call-template name=
"a"><with-param name="a"
select="substring($a,1,($b)-1)"/></call-template>
<call-template name="a"><with-param name="a"
select="substring($a,$b+1)"/>
</call-template></if></template></stylesheet>
I guess the idea is a write-off, but maybe someone will
find those stylesheets interesting.
characters.
It just struck me - JAXSLTH! I mean, why not? XSLT is a
powerful language, and while string processing is not its
strong suit, it has more than enough tricks up its sleeve.
'What a wonderful idea! And something to distract me from
those awful UMLs, too. No, seriously, I just gotta try it.
Who cares if it's useless? I might still learn a thing or
two while doing it.' I'm a really bright fella, you know.
Pointlessness never stopped me from finding a good reason
to write the specs tomorrow.
Anyway, writing a JAXSLTH is not much of problem:
<stylesheet xmlns="http://www.w3.org/1999/XSL/Transform" version="1.0">
<output method="text"/>
<template match="/">Just another XSLT hacker, </template>
</stylesheet>
....but that's not very interesting. Randalschwartzy, yes,
and that can't possibly be a bad thing, but still
uninspiring. Well, it also has the virtue of fitting in the
sig block nicely. And, unfortunately, it seems to be just
about the best that you *can* fit in the sig block.
Something like:
<stylesheet xmlns="http://www.w3.org/1999/XSL/Transform" version="1.0">
<output method="text"/><template match="/"><value-of select="translate(
'Heck twoksid XSLT stupid, ','Htwksiceupd','Janthesuckr')"/></template>
</stylesheet>
....is possible, but that's arguably a worse JAXSLTH than
the first one.
Anyway, unaware of that problem, I started trying. Pretty
soon I came up with the idea of using that otherwise
useless namespace URI as a base string to work with. Half
an hour later I came up with an even better idea of taking
a good look at the XSL FAQ. Turned out, using namespace URI
in obfuscated XSLT is a well-known trick. Oh well. I've no
idea why this was so disheartening: I almost literally
stumbled upon it, and I always knew there are quite a few
people that are smarter than I am. I should've been able to
add two and two toghether and realize this has already been
done before (not that realizations like that ever stopped
me from reinventing the wheel). Nevertheless, I decided I'd
better get some, uh, work done and fired up the umbrello.
After looking at it for two minutes straight with a
*really* dumb look on my face, I gave up and went back to
toying with XSLT.
Another half an hour later, when I was deep in thinking of
ways to obfuscate the data, I suddenly realized that the
stylesheet I was working on was getting really long. 'Not
much of a JAXSLTH, that', I told myself. After applying the
KISS principle I was left with a stylesheet that was still
about twice as long as I needed. I toyed with substring-foo
and decimal-format for a while, but that wasn't getting me
anywhere. At this point:
<stylesheet xmlns="http://www.w3.org/1999/XSL/Transform" version="1.0">
<output method="text"/><template match="*"><call-template
name="a"><with-param
name="a">0806320220303115020111162024252628200130133611160420</with-param>
</call-template></template><template name="a"><param name="a"/><if
test="$a">
<value-of
select="substring(translate(namespace-uri(document('')/*),'w/p91.3m',
'Ju, jeck'),substring($a,1,2),1)"/><call-template name="a"><with-param
name="a"
select="substring($a,3)"/></call-template></if></template></stylesheet>
....I decided to try something else (for relatively small
values of 'else').
Unfortunately, even after giving up that ugly long string
literal and applying a nice little transformation to the
namespace URI, I was still left with:
<stylesheet xmlns="http://www.w3.org/1999/XSL/Transform"
version="1.0"><output
method="text"/><template match="*"><param name="x"><call-template
name="a">
<with-param name="s"
select="namespace-uri(document('')/*)"/></call-template>
</param><value-of select="translate($x,'19o3g:/pwrfans.htm',
'r toet sahc hanJuk')"/>er, </template><template name="a"><param
name="s"/><if
test="$s"><value-of select="substring($s,1,1)"/><call-template
name="a">
<with-param name="s"
select="translate(substring($s,2),substring($s,1,1),'')"
/></call-template></if></template></stylesheet>
Not good enough. (Actually, it's worse than the previous
example.)
I tried various minor optimizations, but again, that wasn't
getting me anywhere.
I increased the value of 'else' a little. But still:
<stylesheet xmlns="http://www.w3.org/1999/XSL/Transform" version="1.0">
<output method="text"/><param name="JkXSLT"><apply-templates select=
"document (concat('',''))/*"/></param><template match="/" name="a">
<param
name="a">4622010281381716020705138148495051810738714705139281</param>
<if test="$a"><value-of
select="substring($JkXSLT,substring($a,1,2),1)"/>
<call-template name="a"><with-param name="a" select="substring($a,3)"/>
</call-template></if></template><template match="*|@*"><value-of
select=
"name()"/><if test="not(node())"><value-of select="string()"/></if>
<apply-templates select="*|@*"/></template></stylesheet>
Way too long.
I decided to try something simpler and more elegant, and:
0.5"/><if test="$a"><value-oft sanuthore JLTSh aXkec,r </param><param name="b" select="string-length($a)*
select="substring($a,$b,1)"/><call-template name=
"a"><with-param name="a"
select="substring($a,1,($b)-1)"/></call-template>
<call-template name="a"><with-param name="a"
select="substring($a,$b+1)"/>
</call-template></if></template></stylesheet>
I guess the idea is a write-off, but maybe someone will
find those stylesheets interesting.