[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

hyperlinks

Subject: hyperlinks
From: Rosa I-Ting Cheng <Rosa@xxxxxxxxxxxxx>
Date: Thu, 1 Feb 2001 10:44:11 +1100
xsl and hyperlinks
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
  • hyperlinks
    • Rosa I-Ting Cheng - Wed, 31 Jan 2001 18:44:26 -0500 (EST) <=

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.