473,395 Members | 1,341 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

xsl magic

I have an xml document containing properties for a group of hyperlinks.
Currently my xsl:stylesheet contains code as follows:
<a href="{concat(/links/@webroot,@url)}" title="My ToolTip Here">
<xsl:value-of select="@name"/></a>
I want to replace "My ToolTip Here" with the contents of the @description
element.
I have not been able to get the syntax right. Please help.

Jan 30 '06 #1
2 1098


Jerry Langley wrote:

Currently my xsl:stylesheet contains code as follows:
<a href="{concat(/links/@webroot,@url)}" title="My ToolTip Here">
<xsl:value-of select="@name"/></a>
I want to replace "My ToolTip Here" with the contents of the @description
element.

With an attribute value template you can put an XPath expression in
curly braces e.g.
<a title="{description}"
href="{concat(/links/@webroot,@url)}">
if description is a child element of the context node or e.g.
<a title="{@description}"
href="{concat(/links/@webroot,@url)}">
if description is an attribute of the context node.
Your description "of the @description element" does not really make
sense, if you have an element with element name description then the
XPath is
description
only if it is an attribute and not an element you use
@description

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Jan 31 '06 #2
cd~
A solution would be the <xsl:attribute> element

it would look something like this

<a href=""><xsl:attribute name="title"><xsl:value-of select="[path to
description attribute/element]"></xsl:attribute></a>

"Martin Honnen" <ma*******@yahoo.de> wrote in message
news:uv**************@TK2MSFTNGP09.phx.gbl...


Jerry Langley wrote:

Currently my xsl:stylesheet contains code as follows:
<a href="{concat(/links/@webroot,@url)}" title="My ToolTip Here">
<xsl:value-of select="@name"/></a>
I want to replace "My ToolTip Here" with the contents of the @description
element.

With an attribute value template you can put an XPath expression in curly
braces e.g.
<a title="{description}"
href="{concat(/links/@webroot,@url)}">
if description is a child element of the context node or e.g.
<a title="{@description}"
href="{concat(/links/@webroot,@url)}">
if description is an attribute of the context node.
Your description "of the @description element" does not really make sense,
if you have an element with element name description then the XPath is
description
only if it is an attribute and not an element you use
@description

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/

Jan 31 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Dave Moore | last post by:
Hi All, Can anybody point me to a FAQ or similar that describes what all this stuff is about please?. I'm interfacing with a MySQL database if that's relavent. I've read a couple of books which...
0
by: Nilsson Mats | last post by:
Hi! I have an intresting problem for our programming community on Solaris. I want to develop an environment where: 1) The developers shouldn't need to bother about which Perl version to use....
19
by: youpak2000 | last post by:
Are MAGIC numbers always bad? Using magic numbers (constant numbers) in programs are generally considered a bad programming practice, and it's recommended that to define constants in single,...
51
by: Kuku | last post by:
What is the difference between a reference and a pointer?
0
by: KronicDeth | last post by:
I have a package of python modules deployed on an NFS mount on my network that I use for sysadmin tools. Since some of the machines use different versions of python I've only put the .py files in...
16
by: per9000 | last post by:
Hi, I recently started working a lot more in python than I have done in the past. And I discovered something that totally removed the pretty pink clouds of beautifulness that had surrounded my...
2
by: jyck91 | last post by:
i have done the magic square: #include <stdio.h> #include <stdlib.h> #include <string.h> #define SIZE 13 main() { FILE *fp; int i, j, n, row, column;
1
by: manju01 | last post by:
in the below program we can generate magic square of size 3-160 but i want to print the output like for magic size n ************************ * * * * * * 5 * 8 * 7 *...
6
by: tinman77 | last post by:
Hello, I'm having a terrible time using the functions finfo_open and finfo_file. I'm using PHP 5 on IIS 5.1 and Windows XP. I have enabled php_mime_magic.dll and php_fileinfo.dll and also added...
9
by: Larry Hale | last post by:
I've heard tell of a Python binding for libmagic (file(1) *nixy command; see http://darwinsys.com/file/). Generally, has anybody built this and worked with it under Windows? The only thing I've...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.