RobLog

Web Design in the World of .NET (C# and VB.NET, XML, and Javascript). I learned how to program from TheDailyWTF.com!
posts - 140, comments - 129, trackbacks - 5

My Links

News

Main Site Cert Corner Goals About Me

Article Categories

Archives

Post Categories

Image Galleries

.NET

Personal

WOW


XSLT Button Code Snipptet (ADA Compliant)

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'< /
xsl:text>
        < /
xsl:attribute>
       
<xsl:attribute name
="onFocus">
           
<xsl:text disable-output-escaping="yes">this.className='underline'< /
xsl:text>
        < /
xsl:attribute>
       
<xsl:attribute name
="onMouseOut">
           
<xsl:text disable-output-escaping="yes">this.className=''< /
xsl:text>
        < /
xsl:attribute>
       
<xsl:attribute name
="onBlur">
           
<xsl:text disable-output-escaping="yes">this.className=''< /
xsl:text>
        < /
xsl:attribute>
       
<xsl:value-of select="title"
/>
    < /span>
< /
div
>

The class “underline” that is being referred to is:

.underline {
    text-decoration:underline;
}

posted on Tuesday, June 22, 2004 2:07 AM