[xsl] hyperlinks

Subject: [xsl] hyperlinks
From: Rosa I-Ting Cheng <Rosa@xxxxxxxxxxxxx>
Date: Thu, 1 Feb 2001 10:44:11 +1100
Can anyone please tell me how I can display the following XML

<document>
<title>
hello world
</title>
<bodycopy>
this is my uni web site <link>http://www.uts.edu.au/</link>
</bodycopy>
</document>

into a sentence with the link as hyperlink.  Cos at the moment the link tag
info is just as CDATA. 
this is the XSL:

<xsl:template match="*">
   <xsl:choose>
   <xsl:when test="name()='title'">
      <P class="bodytitle"><xsl:value-of select="."/></P>
      <xsl:apply-templates select="link"/>
   </xsl:when>
   <xsl:when test="name()='bodycopy'">
      <xsl:choose>
      <xsl:when test="@type='numbered'">
         <LI class="bodycopy"><xsl:value-of select="."/></LI>
      </xsl:when>
      <xsl:when test="@type='subtitle'">
         <P class="bodycopy"><B><xsl:value-of select="."/></B></P>
      </xsl:when>
      <xsl:otherwise>
         <P class="bodycopy"><xsl:value-of select="."/></P>
      </xsl:otherwise>
      </xsl:choose>
   </xsl:when>
   <xsl:otherwise>
wrong input
   </xsl:otherwise>
   </xsl:choose>
</xsl:template>

<xsl:template match="link">
<xsl:variable name="ref" select="."/>
<A href="{$ref}"><xsl:value-of select="."/></A>
</xsl:template>

I tried to put <xsl:apply-template select="link"/> somewhere in the "*"
template, but all I get is the data between the <link> tag twice.  One
hyperlinked and the other just as text.

rosa

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


Current Thread