This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Dillemma when creating an XSL template ... how do I do this?
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: Re: [xsl] Dillemma when creating an XSL template ... how do I do this?
- From: "JoshMEagle" <josh dot miller at eagletgi dot com>
- Date: Tue, 13 Feb 2001 17:24:39 -0800
- References: <5.0.0.25.0.20010213171446.04697850@pop3.psinet.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Thanks Chris Gow - a small tweak of your code ended up working ! Here's the
final result:
<xsl:template match="contact">
<p>
<xsl:value-of select="name"/><br/>
<xsl:value-of select="address"/>
<xsl:value-of select="city"/>, <xsl:value-of select="state"/>
<xsl:value-of select="zip"/><br/>
ph.<xsl:value-of select="phone"/><br/>
fax.<xsl:value-of select="fax"/><br/>
<!-- This section -->
<xsl:element name="a">
<xsl:attribute name="href">mailto:<xsl:value-of
select="email"/></xsl:attribute>
<xsl:value-of select="email" />
</xsl:element>
<br/>
<xsl:element name="a">
<xsl:attribute name="href">http://<xsl:value-of
select="url"/></xsl:attribute>
<xsl:value-of select="url" />
</xsl:element>
<br/>
<!-- This section -->
</p>
</xsl:template>
Joshua Miller
Web Development
Eagle Technologies Group, Inc.
Business Solutions for the Next Generation
www.eagletgi.com
josh.miller@eagletgi.com
----- Original Message -----
From: "Chris Gow" <cgow@digitalfairway.com>
To: <xsl-list@lists.mulberrytech.com>
Sent: Tuesday, February 13, 2001 2:16 PM
Subject: Re: [xsl] Dillemma when creating an XSL template ... how do I do
this?
> Try this:
>
> <xsl:template match="email">
> <xsl:element name="a">
> <xsl:attribute name="href"><xsl:value-of
> select="."/></xsl:attribute>
> <xsl:value-of select="." />
> </xsl:element>
> </xsl:template>
>
> Same for url.
>
> Hope this helps
>
> Chris
>
> At 04:45 PM 2/13/01 -0800, you wrote:
> >In the code snippet below, the <email> and <url> elements are inside the
> ><contact> element, and I want to display these as HTML links, any ideas
how
> >I can accomplish this? The way it is below doesn't work.
> >
> >
> ><xsl:template match="contact">
> > <p>
> > <xsl:value-of select="name"/><br/>
> > <xsl:value-of select="address"/>
> > <xsl:value-of select="city"/>, <xsl:value-of select="state"/>
> ><xsl:value-of select="zip"/><br/>
> > ph.<xsl:value-of select="phone"/><br/>
> > fax.<xsl:value-of select="fax"/><br/>
> >
> > <xsl:template match="email">
> > <a>
> > <xsl:attribute name="href"><xsl:value-of select="."
> >/></xsl:attribute>
> > <xsl:text><xsl:value-of select="." /></xsl:text>
> > </a>
> > </xsl:template>
> >
> > <xsl:template match="url">
> > <a>
> > <xsl:attribute name="href"><xsl:value-of select="."
> >/></xsl:attribute>
> > <xsl:text><xsl:value-of select="." /></xsl:text>
> > </a>
> > </xsl:template>
> >
> > </p>
> > </xsl:template>
> >
> >
> >
> >Joshua Miller
> >Web Development
> >Eagle Technologies Group, Inc.
> >Business Solutions for the Next Generation
> >www.eagletgi.com
> >josh.miller@eagletgi.com
> >
> >
> > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
>
============================================================================
===
>
> "It is inhumane, in my opinion, to force people who have a genuine
> medical need for coffee to wait in line behind people who apparently
> view it as some kind of recreational activity."
> -- Dave Barry
>
> --------------------------------------------------------------------------
-----
> Chris Gow Digital Fairway
Corporation
> Software Engineer 180 Attwell Drive
Suite 360
> cgow@digitalfairway.com Etobicoke, ON M9W 6A9
> http://www.digitalfairway.com 416.628.7534
>
============================================================================
===
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list