XSL with tooltips

O

Ofay

I am trying to do a mouseover with tooltips with an XSL stylesheet. I
want to be able to pick data from the XML using the syntax
<xsl:value-of select="CHALLENGE_REMARKS"/> How do I send the data
from this element to the doToolTip function.

Ex.
<td> onmouseover="doTooltip(event,<xsl:value-of
select="CHALLENGE_REMARKS"/>) </td>

This does not work. I have tried putting the element in a var and
this works except when there are multiple rows the mouseover tooltip
only displays the data for the last row for all rows.

Any thoughts?
 
G

George Hester

Maybe:

<td><xsl:attribute name="onmouseover">JavaScript:doTooltip(event,<xsl:value-of select="CHALLENGE_REMARKS" />)</xsl:attribute></td> or something like that. You may need a seperate js file with the JavaScript code and import that near the top of your xsl:

<xsl:template match="/">
<HTML>
<HEAD>
<TITLE>Menu <xsl:value-of select="TOPICLIST/@TYPE" /></TITLE>
<SCRIPT LANGUAGE="JavaScript" SRC="name.js"></SCRIPT>
....
 
O

Ofay

Thanks George:

I actually did some further research and found a solution which works:

<td align="center" width="120">

<a>
<xsl:attribute name="style"><xsl:text>color:#000000;</xsl:text></xsl:attribute>
<xsl:attribute name="href"><xsl:value-of
select="substring(CHALLENGE_REMARKS,1,12)"/></xsl:attribute>
<xsl:attribute
name="onMouseOver">doTooltip(event,'<xsl:value-of
select="CHALLENGE_REMARKS"/>')
<xsl:text> </xsl:text>return true<xsl:text>
</xsl:text></xsl:attribute>
<xsl:attribute name="onmouseout">hideTip()</xsl:attribute>
<xsl:value-of select="substring(CHALLENGE_REMARKS,1,12)"/>

</a>
</td>

Again Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top