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 May 19th, 2007, 06:41 AM
Registered User
 
Join Date: May 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default xslt adding text

in my xslt code:
i got one section,where by the code line is:

<xsl:value-of select="TITLE"/>

and then i got <a href="#{position()}">

i intend do something like
<a href="#{xsl:value-of select="TITLE" } {position()}"> but it gives error. can u tell me how to select current text and add it into a href tag?
or do something like
<a href="#{xsl:value-of select="TITLE" } "> the title would be the reference now.


do let me know.thanx



 
Old May 19th, 2007, 09:03 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

You need to study the rules for attribute value templates more carefully. When using the braces {} you don't need value-of.
Code:
<a href="#{TITLE}">
--

Joe (Microsoft MVP - XML)
 
Old May 19th, 2007, 05:58 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Looks as if you're trying to learn the language by trial and error - never a good technique, but especially so with XSLT.

In <a href="#{position()}">, the construct "#{position()}" is called an attribute value template. The thing inside the curly braces can be any XPath expression. It can't be an XSLT instruction.

So you want <a href="#{TITLE}{position()}">

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old May 19th, 2007, 10:10 PM
Registered User
 
Join Date: May 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanx for the responses.my problem was solved.
yea..sorry to say i was doing a bit of trial and error for this problem. :( :( :(






Similar Threads
Thread Thread Starter Forum Replies Last Post
adding up values in xslt northwind XSLT 21 February 17th, 2017 09:07 AM
xslt adding image palli2004 XSLT 2 December 30th, 2006 06:35 PM
XSLT in IE: adding js object to a stylesheet Vx BOOK: Professional Ajax ISBN: 978-0-471-77778-6 2 August 22nd, 2006 11:00 AM
Adding XSLT transformed XML content dynamically jacob ASP.NET 1.x and 2.0 Application Design 2 December 1st, 2005 04:40 PM
adding elements in XSLT 1.0 spencer.clark XSLT 3 July 25th, 2005 09:41 AM





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