Someone's having a firework party just down the road. Not sure why -- I know it's the Fourth of July, but this isn't America! 22 hrs ago

Monday 17th November, 2008

17
Nov

An XSLT sweetener

If you’ve ever done anything with XSLT, you’ll no doubt be wondering why anyone would want to use such a verbose programming language, given that you need to churn out code such as this all over the place:

<xsl:element name="foo">
  <xsl:attribute name="bar">
    <xsl:value-of select="/some/xpath/@expression" />
  </xsl:attribute>
</xsl:element>

However, did you know that you can do this instead? Much cleaner and easier to read:

<foo bar="{/some/xpath/@expression}" />

(Hat tip: Ned Batchelder)