This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Transforming into embedded HTML
- From: "Max Dunn" <maxdunn at siliconpublishing dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Thu, 6 Jun 2002 20:52:28 -0700
- Subject: RE: [xsl] Transforming into embedded HTML
- Reply-to: xsl-list at lists dot mulberrytech dot com
This is the reason that God created Attribute Value Templates...
for example
http://www.ibiblio.org/xml/slides/xmloneaustin2001/xslt/21.html
Max
-----Original Message-----
From: owner-xsl-list@lists.mulberrytech.com
[mailto:owner-xsl-list@lists.mulberrytech.com] On Behalf Of jmabbate
Sent: Thursday, June 06, 2002 8:37 PM
To: XSL-List@lists.mulberrytech.com
Subject: [xsl] Transforming into embedded HTML
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
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list