XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
steven matthewsSubject: Hyperlinks in XSLT ?
Author: steven matthews
Date: 28 Dec 2006 11:11 AM
HI Team,

I would like to know how to create hyperlinks in XSLT. In the following code snippet there is a line

<td><xsl:value-of select="HS_EMAIL"/></td>

The value HS_EMAIL contains an email address.

How could I wrap this in a <a href></a> tag so that when clicked in the displayed HTML, it would invoke the email program so thatthe person could be emailed directly ? The problem is that I need to say
"mailto: HS_EMAIL"

CODE SNIPPET:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/SERVICES">
<html>
<body bgcolor="#F5DF91">
<title>Displaying dynamically generated XML using XSL</title>

<h2>Here are the student housing details ...</h2>

<!-- display first table headers -->
<table border="5" cellpadding = "5" bgcolor="#F5DF91" align = "center" summary = "Results">
<tr bgcolor="#9acd32">
<th>Count</th>
<th>Hall Name</th>
<th>Hall Address</th>
<th>Director</th>
<th>Email Address</th>
</tr>


<!-- Start main loop here -->
<xsl:for-each select="ITEM">

<!-- display PRODUCT details in a table -->
<tr>
<td><xsl:value-of select="ITEMCOUNT"/></td>
<td><xsl:value-of select="HS_NAME"/></td>
<td><xsl:value-of select="HS_ADD"/></td>
<td><xsl:value-of select="HS_DIRECTOR"/></td>
<td><xsl:value-of select="HS_EMAIL"/></td>
</tr>

</xsl:for-each>

<!-- Close table -->
</table><br /><br />

</body>
</html>

</xsl:template>
</xsl:stylesheet>

Steven matthews

Posttop
Minollo I.Subject: Hyperlinks in XSLT ?
Author: Minollo I.
Date: 28 Dec 2006 01:06 PM
<td><a href="{concat("mailto:",HS_EMAIL)}"><xsl:value-of select="HS_EMAIL"/></a></td>

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.