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 July 25th, 2008, 07:38 AM
Authorized User
 
Join Date: Jul 2008
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default Assigning node value to a href element!!!!!!!!!

Hi All,

I have got arequirement to assign value of a node to an href element. Any idea on how to do this?

I tried like this

<a href='<xsl:value-of select="s:CriminalRecord//d8p1:BinaryReferenceID/d8p1:ID"/>'>Photo</a>

which is not working. Then i tried this way also

<xsl:variable name ="test" select="s:CriminalRecord//d8p1:BinaryReferenceID/d8p1:ID"></xsl:variable>
              <a href="$test">Photo</a>

This also doesnt seem to work. Please help me on this.



 
Old July 25th, 2008, 07:44 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Can I suggest you either read some online tutorials or get a good book as this is a fundamental part of XSLT.

In the mean time look into using either the <xsl:attribute> instruction or the "{xpath}" notation.

/- Sam Judson : Wrox Technical Editor -/
 
Old July 25th, 2008, 08:12 AM
Authorized User
 
Join Date: Jul 2008
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks jason and sorry for the silly question

 
Old July 25th, 2008, 08:29 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Jason? Who is Jason?

/- Sam Judson : Wrox Technical Editor -/
 
Old July 25th, 2008, 03:17 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Look up "attribute value templates". You can embed an XPath expression within curly braces:

<a href="{s:CriminalRecord//d8p1:BinaryReferenceID/d8p1:ID}">

or of course

<a href="{$test}">

Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
How Retrieve data of a node or from an element chandu.mca007 XML 1 December 16th, 2006 03:11 PM
Reading every element from the specified node ROCXY XSLT 1 January 3rd, 2006 09:25 AM
adding of element and assigning to one element sushovandatta XSLT 2 November 16th, 2004 07:04 PM
assigning a css style sheet from an element miguel XSLT 7 August 8th, 2004 01:21 PM
How can I get the element node of an attribute cdias XSLT 2 March 15th, 2004 10:34 AM





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