This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
XSL question for email link
- From: Jeff Self <jocknerd at cox dot net>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Sun, 07 Jul 2002 17:44:52 -0400
- Subject: [xsl] XSL question for email link
- Reply-to: xsl-list at lists dot mulberrytech dot com
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@somewhere.com</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"><a href="mailto:"</xsl:text>
<xsl:value-of select="child::EMAIL"/>
<xsl:text disable-output-escaping="yes">></xsl:text>
<xsl:value-of select="FIRST"/>
<xsl:text> </xsl:text>
<xsl:value-of select="LAST"/>
<xsl:text disable-output-escaping="yes"></a></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