Stupid XSLT tricks

Sun, Mar 9, 2003

In talking with Jorge about how he does his site, he pointed me to his XSLT source. I'll let him post links to those on his own site ifi he wants to. However, he knows some advanced moves that I haven't discovered yet. Here is one of them: http://www.w3.org/TR/xslt#dt-attribute-value-template. This is a huge keystroke saver. It lets me go from this:

<A class="ArchiveLink">
    <xsl:attribute name="href">
        <xsl:value-of select="$SiteRoot"/><xsl:value-of 
            select="user:FormatArchiveLink(LocalPubDate)"/>#a<xsl:value-of 
            select="BlogEntryNumber"/>
    </xsl:attribute>
    <!--....-->
</A>

To this:

<A class="ArchiveLink" href="{$SiteRoot}{user:FormatArchiveLink(LocalPubDate)}#a{BlogentryNumber}">
    <!--....-->
</A>

Very cool!