Click to See Complete Forum and Search --> : using gz_tooltip.js in XSL


t.oby
06-10-2008, 02:14 PM
Hello,

I would like load a XML File in my Browser with some tooltips. My XML File looks like this:

<cd>
<name type="last-name|first-name" type2="jnames">James</name>
<year>1987</year>
</cd>
<cd>
<name type="last-name|institution-name|city-name" type2="bnames">Berlin</name>
<year>1987</year>
</cd>

my XSL document looks like this:

<xsl:template match="/">
<html>
<body>
<script language="JavaScript" src="wz_tooltip.js"></script>
<xsl:for-each select="cd/name">
<a>
<xsl:attribute name="onmouseover">
Tip('<xsl:value-of select="@type"/><br><xsl:value-of select="@type2"/>')
</xsl:attribute>
<xsl:attribute name="onmouseout">
UnTip()
</xsl:attribute>
</a>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

What I would like is a tooltip with a line break (First line values of attribute "type" and second line attributes of "type2"). Ok perfect would be to have the "|"-seperated tags also linewise, but this is not my main problem for now :)

Unfortunately the <br> in the mousover Event does not work in the XSL File. In the HTML version as described in http://www.walterzorn.com/tooltip/tooltip_e.htm it works.

If anybody has already worked with "JavaScript, DHTML Tooltips" and has any ideas I would be very thankful!

Regards,
T.oby