XT days-ago extension function

Subject: XT days-ago extension function
From: Linda van den Brink <lvdbrink@xxxxxxx>
Date: Mon, 9 Aug 1999 14:04:01 +0200
Hi everyone,

I have a question about one of XT's extension functions. I'm trying to use
the utils:days-ago function to create a What's New page. But it's not doing
anything as far as I can see. I would really like to understand what's
wrong! When I test if the function is available, XT doesn't say it's not
available. My xsl just doesn't select any elements... 

Any help would be appreciated! 

> My xsl (the relevant fragment) is: 
> 
> <xsl:stylesheet  xmlns:xsl="http://www.w3.org/XSL/Transform/1.0";
>   xmlns:utils="http://www.jclark.com/xt/java/Utils";
>   xmlns="http://www.w3.org/TR/REC-html40";
>   result-ns="">
> 
> <xsl:template match="psa">
> 	<html><head><title>What's new on the PSA</title><link
> rel="stylesheet" type="text/css"
> href="../../../styles/intro.css"></link></head><body><table
> class="bannerList"><tr><td class="bannerList">What's
> New</td></tr></table><table style="margin-top: 30px;"><tr><td
> colspan="2"><h4 style="margin-bottom: 10px">Application</h4></td><td
> colspan="1"><h4 style="margin-bottom: 10px">Description</h4></td></tr>
> 		<!-- this works: <xsl:apply-templates
> select="//item[@new='1999-08-08']"/> -->
> 		<xsl:if
> test="extension-function-available('utils:days-ago')">
> 			<xsl:apply-templates
> select="//item[@new='utils:days-ago(0)']"/>
> 			<xsl:apply-templates
> select="//item[@new='utils:days-ago(1)']"/>
> 			<xsl:apply-templates
> select="//item[@new='utils:days-ago(2)']"/>
> 			<xsl:apply-templates
> select="//item[@new='utils:days-ago(3)']"/>
> 			<xsl:apply-templates
> select="//item[@new='utils:days-ago(4)']"/>
> 			<xsl:apply-templates
> select="//item[@new='utils:days-ago(5)']"/>
> 		</xsl:if>
> 	</table></body></html>
> </xsl:template>
> 
> </xsl:stylesheet>
> 
> The XML is like this: 
> 
> <software>
> 	<item new="1999-08-08">
> 		<name>W2CSS</name>
> 		<version>2</version>
> 		<desc>Description goes here...</desc>
> 		<size>859 KB</size>
> 		<url>w2css</url>
> 		<home>http://www.g-foods.com/w2css/</home>
> 		<license>Shareware</license>
> 		<install>Unpack</install>
> 	</item>
> 
> </software>
> 


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


Current Thread