Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 15th, 2008, 09:37 AM
Friend of Wrox
 
Join Date: Jan 2007
Posts: 115
Thanks: 2
Thanked 0 Times in 0 Posts
Default Set Div ID value = ttip_<xsl:value-of select='@nam

Hi, I'm using this HTML code to set my tooltip.

I get it working in HTML then i incorporated it in xslt.
I got it to work for only the first field value then i realized i was not changing the "DIV ID" value to point to the ttip_<xsl:value-of select='@name' />
[u]
This is the HTML example:
</u>
Code:
<a href="http://www.dynamicdrive.com/style/" rel="balloon1">??</a> 
<div id="balloon1" class="balloonstyle">Test</div>
The rel="balloon1" is equal to the div id="balloon1"
I get the Rel in the xslt going but can't connect with the DIV ID as it moans about the code in bold!

Code:
<a> 
<xsl:attribute name='href'>ajax.htm</xsl:attribute> 
<xsl:attribute name='rel'>ttip_<xsl:value-of select='@name' /></xsl:attribute>?? 
</a> 

<div id="ttip_<xsl:value-of select='@name'/>"  class="balloonstyle"> 
<xsl:value-of select="Tooltip" /> 
</div>
Please Assist!

 
Old January 15th, 2008, 09:48 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

I don't understand how you can manage to have the correct code in the exact same example as the incorrect code. Try looking two lines up and seeing how its done there.

/- Sam Judson : Wrox Technical Editor -/
 
Old January 15th, 2008, 09:49 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Code:
<a href="ajax.htm" rel="ttip_{@name}"></a>

<div id="ttip_{@name}"  class="balloonstyle"> 
<xsl:value-of select="Tooltip" /> 
</div>
--

Joe (Microsoft MVP - XML)
 
Old January 15th, 2008, 10:17 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

XSLT stylesheets are XML documents, and you can't have elements inside attributes. So you need the attribute value template syntax,

<e att="abc{@def}ghi">

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old January 16th, 2008, 05:04 AM
Friend of Wrox
 
Join Date: Jan 2007
Posts: 115
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Thank You very much - Great stuff !!!

Thank You Joe & All for all the help, assistance & patience!
I started feeling bad posting everytime as I was being a nuisance and a pain.

My search to fix the tooltip has come to an end:

As you came across i have no experience in xslt - just recently started looking into making changes to the file. As I'm coding in Flowcentric which uses xslt as stylesheet & users wanted changes to the app. So i started playing with the xslt file.

[u]This did solve my problem to fix the tooltip! </u>

<a href="ajax.htm" rel="ttip_{@name}"></a>

<div id="ttip_{@name}" class="balloonstyle">
<xsl:value-of select="Tooltip" />
</div>



Thank You for your kindness & patience!!!
Regards







Similar Threads
Thread Thread Starter Forum Replies Last Post
When <xsl:value-of select="Tooltip" /> = value ismailc XSLT 3 October 17th, 2008 04:43 AM
change the text color of (<xsl:value-of select="De ismailc XSLT 2 August 25th, 2008 07:25 AM
<xsl:for-each select="tokenize($indoc,'&#xA;')"> kapy_kal XSLT 4 June 9th, 2006 07:33 AM
<xsl:for-each> with a variable select="attribute" BeneathClouds XSLT 1 August 1st, 2005 03:36 AM
HELP: XSL -> HTML <select selected=true> jedbartlett XSLT 4 October 7th, 2004 11:16 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.