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

links in xsl:for-each

Subject: links in xsl:for-each
From: Kris Paelman <kpaelman@xxxxxxxxxxxxxxx>
Date: Wed, 29 Mar 2000 19:03:09 +0200 (CEST)
link xsl
Hello,

Another newbie question:

Since I found the following link in one of the newbee mails,

http://metalab.unc.edu/xml/books/bible/updates/14.html#XSL

I checked it out and tried to solve my problem, but I failed.

I have records in XML-format and I'm trying to add hyperlinks to the
<TITLE> field of my records. Using a for-each statement, I'm forced to use
parameter passing since every title needs another hyperlink.

Based on what I've found on the site described earlier, I've made the
following of it, but without succes :


I've extended every record with a ANCHOR field.

....
<xsl:for-each select="/FILE/RECORD">
<TR>
<TD >
<font color="indigo">
<xsl:apply-templates select="DATE/text()"/>
</font>								
</TD>

<xsl:template match="ANCHOR">
<xsl:call-template name="HYPERLINK">
<xsl:with-param name="link">
</xsl:with-param>	
<xsl:value-of select="."/>
</xsl:call-template>
</xsl:template>
							
<TD >
<xsl:apply-templates select="ORIG_TITLE/text()"/>
</TD>

....
At the end of the file :

</xsl:for-each>
</TABLE>
</BODY>
</HTML>
</xsl:template>
<xsl:template match="*">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="text()">
<xsl:value-of select="."/>
</xsl:template>
	<xsl:template name="HYPERLINK">
  	<xsl:with-param name="link"></xsl:with-param>
  	<td>
	<font SIZE="5" color="red">		
	<b>
        <a href="{$link}">xsl:value-of select="."/></a>
      	</b>
    	</font>
  	</td>
	</xsl:template>
</xsl:stylesheet>

And the error message :
-----------------------
Keyword xsl:template may not be used here. 


						Kind regards,



						Kris Paelman
						Belgian student.



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


Current Thread

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.