[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] links in xsl:for-each
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|