Stop Spam Harvesters, Join Project Honey Pot


First of all, if you need to work with an XSLT 1.0 processor (such as xsltproc/libxslt), EXSLT defines some non standard extensions to XSLT for string and date manipulation, user-defined functions, and more.


Stolen from

  <item key="a" value="1" />
  <item key="b" value="2" />
  <!-- ... -->
<xsl:variable name="myMap" select="document('')/*/map"/>
<xsl:value-of select="$myMap/*[@key='b']/@value" />

Allows storing arbitrary mappings inside an XML/XSLT document.