For those of you who have used XSLT (eXtensible Stylesheet Language Transformation) to transform XML into whatever, you know it can perhaps be a pain sometimes. I have been learning the easy parts of it to try and markup a document at work, and also to get this blog to look pretty and usable.
Here is a code snippet for something I have learned that is pretty cool.
Before I just throw it out there, this is part of the XSLT that transforms this page on robz.webhop.org that links over to the main Blog. That is in the header and in the feedback links.
<div>
<xsl:attribute name="OnClick">
<xsl:text>javascript:window.open('< /xsl:text>
<xsl:value-of select="link" />
<xsl:text>')< /xsl:text>
< /xsl:attribute>
<xsl:attribute name="OnKeyPress">
<xsl:text>javascript:window.open('< /xsl:text>
<xsl:value-of select="link" />
<xsl:text>')< /xsl:text>
< /xsl:attribute>
<span style="cursor:hand;">
<xsl:attribute name="onMouseOver">
<xsl:text disable-output-escaping="yes">this.className='underline'< /< FONT>xsl:text>
< /< FONT>xsl:attribute>
<xsl:attribute name="onFocus">
<xsl:text disable-output-escaping="yes">this.className='underline'< /< FONT>xsl:text>
< /< FONT>xsl:attribute>
<xsl:attribute name="onMouseOut">
<xsl:text disable-output-escaping="yes">this.className=''< /< FONT>xsl:text>
< /< FONT>xsl:attribute>
<xsl:attribute name="onBlur">
<xsl:text disable-output-escaping="yes">this.className=''< /< FONT>xsl:text>
< /< FONT>xsl:attribute>
<xsl:value-of select="title" />
< FONT> < /span>
< /div>
The class “underline” that is being referred to is:
.underline {
text-decoration:underline;
}