Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
| Search | Today's Posts | Mark Forums Read
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 December 7th, 2008, 05:00 AM
Registered User
 
Join Date: Dec 2008
Location: delhi, delhi, India.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ashv
Default XSLT to get hyperlinks in output

Hi All,

I have an XSLT, which is rendering/parse XML to generate html page.
Generated html page have href links and I am using the below lines to get those links.

<a href="sample.xml"><xsl:value-of select="val"/></a>

Is there any other way to specify URL in generated html page.
Xlink is not working as generated page (i.e. output of XSLT) is html page and Xlink is not getting in output.

Appreciate your quick response.


Regards,
./Ash
 
Old December 7th, 2008, 06:14 AM
samjudson's Avatar
Friend of Wrox
Points: 8,687, Level: 40
Points: 8,687, Level: 40 Points: 8,687, Level: 40 Points: 8,687, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Either use the xsl:attribute element, or do it like this:

<a href="{@href}">...</a>

/- Sam Judson : Wrox Technical Editor -/
 
Old December 7th, 2008, 06:14 AM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

You haven't explained why the output you are getting (<a href=...">) is unsuitable. Is it because you don't want to link to sample.xml, but to some file sample.html obtained by transforming sample.xml? In that case it rather depends on how you are organizing the transformation - in advance at publication time, on demand server-side, or on-demand client side.

You'll find examples of how to handle all three in the Genealogy case study chapter of my book.

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
changing output for one node in XSLT shane_carty XSLT 3 February 27th, 2008 05:28 AM
XSLT with output very similar to input sindrit XSLT 2 July 30th, 2007 08:38 AM
XSLT output with tags trinkets XSLT 22 November 14th, 2006 11:22 AM
XSLT Looks right, but no output Alderian72 XSLT 1 June 9th, 2005 08:47 AM
hyperlinks in XSLT, please help. figit XSLT 1 May 6th, 2005 03:06 AM





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