W3C home > Mailing lists > Public > public-webapi@w3.org > March 2006

Re: A few tweaks for ReSpec

From: Jonas Sicking <jonas@sicking.cc>
Date: Sun, 26 Mar 2006 02:13:18 -0800
Message-ID: <4426693E.3000902@sicking.cc>
To: Maciej Stachowiak <mjs@apple.com>
Cc: "Web APIs WG (public)" <public-webapi@w3.org>

The XSLT nazi in me is showing his ugly face. Feel free to ignore, 
though i do think it makse the stylesheet easier to read.

> +      <xsl:element name='a' namespace='http://www.w3.org/1999/xhtml'>
> +      <xsl:attribute name='class'>term</xsl:attribute> 

Why not simply

<a class="term">

(assuming the default namespace in the stylesheet is xhtml).

> +      <xsl:if test='@xml:id'>
> +        <xsl:attribute name='id'><xsl:value-of select='@xml:id'/></xsl:attribute>
> +      </xsl:if>
> +      <xsl:attribute name='href'>
> +        <xsl:value-of select='concat("#dfn-", translate(normalize-space(.), " ABCDEFGHIJKLMNOPQRSTUVWXYZ", "-abcdefghijklmnopqrstuvwxyz"))'/>
> +      </xsl:attribute>

You could even include the href attribute by doing

<a class="term"
    href="#dfn-{translate(normalize-space(.), 
'ABCDEFGHIJKLMNOPQRSTUVWXYZ', '-abcdefghijklmnopqrstuvwxyz')}">

/ Jonas
Received on Sunday, 26 March 2006 10:13:11 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:18:54 GMT