This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Transforming into embedded HTML
- From: "jmabbate" <jmabbate at directvinternet dot com>
- To: <XSL-List at lists dot mulberrytech dot com>
- Date: Thu, 6 Jun 2002 23:36:39 -0400
- Subject: [xsl] Transforming into embedded HTML
- Reply-to: xsl-list at lists dot mulberrytech dot com
I am trying to convert a web page that in essence is a directory
of members of a local association. A typical entry looks something
like this:
ABC Company John Smith
123 Main Street
john@smith.com
The last item, the email address, is presented as a link. In
other words, the actual html is
<a href="mailto:john@smith.com">john@smith.com</a>
I created an XML version of the directory along these lines
<directory>
<member>
<company>ABC Company</company>
<contact>John Smith</contact>
<address>123 Main Street</address>
<email>john@smith.com</email>
</member>
...
</directory>
To display this as HTML, I created an XSL file with a
<xsl:for-each select="directory/member"> loop. The trouble
I'm having is with the email. I basically need to include
john@smith.com both as a value for the href attribute and
as plain text. As far as I can tell, the commands cannot
be nested like this
<a href="mailto:<xsl:value-of select="email"/>"><xsl:value-of
select="email"/></a>
I tried escaping the angle brackets and quotes as follows:
<a href="mailto:<xsl:value-of
select="email"/>"><xsl:value-of select="email"/></a><br />
but the resulting html displays the <a href= ...> instead of a
link. I'm using a Javascript under MSIE 6.0 to test the
transformation.
It seems to me that this is not a unusual transformation but
I have looked in the XSL-List archives and XSL FAQ and couldn't
find anything on this topic.
Thanks in advance for any insights.
Joe
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list