[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Creating Hyperlinks using xlink

Subject: Creating Hyperlinks using xlink
From: "Rudi Starcevic" <rudi@xxxxxxxxxxxx>
Date: Wed, 9 Jul 2003 23:53:38 +1000
creating hyperlinks in xml
Hi,

When creating an active link from an xml file using xlink, code below,
all works fine except selecting the 'href' attribute.

I had some code creating an active hyperlink working without xlink
but soon found out that if one want to pass in parameter's with the href,
eg index.php?id=1&action=login&type=new, xlink is required.

In my code below everything render's well except the actual value, @href,
for the <a></a> tag.

For example this line from my 'address' xsl:template,
<a href="{xlink:simple/@href}"><xsl:value-of select="."/></a>,
in the rendered html document the {xlink:simple/@href} is blank but the
<xsl:value-of select="."/> is fine.

I must be missing something simple again.
Sure is tricky this xslt but I sure like it.

Can you see where I'm going wrong ?

Thanks
Regards
Rudi.

XML file:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="webapps.xsl"?>

<webapps xmlns:xlink="http://www.w3.org/1999/xlink">

<website name="Footyworld">

<address
 xlink:type="simple"
 xlink:href="http://www.footyworld.com">www.footyworld.com</address>

</website>	

</webapps>

XSL file:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" 
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:xlink="http://www.w3.org/XML/XLink/0.9">

<xsl:template match="/">
<html>
<head><title>Web app. list</title></head>
<body>

<xsl:for-each select="webapps/website">
<table border="1" summary="Web Application Table">
 <xsl:apply-templates select="address"/>
</table>
</xsl:for-each>

</body>
</html>
</xsl:template>

<xsl:template match="address">
<tr>
<td>URL:</td>
<td><a href="{xlink:simple/@href}"><xsl:value-of select="."/></a></td>
</tr>
</xsl:template>

</xsl:stylesheet>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.