RE: [xsl] <a class="..." href="..." problem

Subject: RE: [xsl] <a class="..." href="..." problem
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 30 Jan 2006 00:36:04 -0000
> Alternatively you can try encoding your output xml/xhtml tags.
> &lt;a class="navigation" id="selected" href="<xsl:value-of 
> select="url" />"
> &gt;
> 	<xsl:value-of select="title" />
> &lt;/a&gt;
> 
> The second method can is a good way to go if you are using 
> the XSLT on the
> client in Mozilla based browsers as it tends to be much faster.
> 

It's disappointing to see such bad advice offered on this list. The person
who offered it hasn't grasped that XSLT is a language for transforming
trees, not for twiddling lexical markup. There might be some environments
where the above works (though it surprises me that it should work anywhere)
but it's certainly an abuse of the language and the effects will be very
dependent on how the stylesheet is run. There are a few cases where you need
to take desperate measures such as this to achieve a required effect, but
this certainly isn't one of them.

Michael Kay
http://www.saxonica.com/

Current Thread