[xsl] XSL question for email link

Subject: [xsl] XSL question for email link
From: Jeff Self <jocknerd@xxxxxxx>
Date: Sun, 07 Jul 2002 17:44:52 -0400
I'm having difficulty getting XSL to produce a html page with a mailto link..
I want to produce an html page that lists member names but as a mailto link (while displaying their member names).


Here's what I've got so far:
members.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<MEMBERS>
   <MEMBERINFO>
       <NAME>
           <FIRST>Joe</FIRST>
           <LAST>Smith</LAST>
       </NAME>
       <EMAIL>jsmith@xxxxxxxxxxxxx</EMAIL>
   </MEMBERINFO>
</MEMBERS>

members.xsl:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version "1.0" xmlns:xsl="http:www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head><title>Member List</title></head>
<body>
<table>
<xsl:apply-templates/>
</table>
</body>
</html>
</xsl:template>


<xsl:template match="MEMBERINFO">
   <tr>
       <td><xsl:apply-templates select="NAME"/></td>
   </tr>
</xsl:template>

<xsl:template match="NAME">
   <xsl:text disable-output-escaping="yes">&lt;a href="mailto:";</xsl:text>
   <xsl:value-of select="child::EMAIL"/>
   <xsl:text disable-output-escaping="yes">&gt;</xsl:text>
   <xsl:value-of select="FIRST"/>
   <xsl:text> </xsl:text>
   <xsl:value-of select="LAST"/>
   <xsl:text disable-output-escaping="yes">&lt;/a&gt;</xsl:text>
</xsl:template>

</xsl:stylesheet>

When I transform the xml document to html, it displays the member name and provides a mailto link but it leaves the mailto link blank. Am I going about this all wrong? If so whats the solution?



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


Current Thread