I am attempting to do some date arithmetic to assist in some Conditional Formatting on a Sharepoint web site. Disappointingly, this is not straightforward because of the format the dates are returned in. My question (which likely is one of the stupider ones on here) is simply, how exactly do I call a template?
I found a very good template for performing Date Arithmetic here:
http://www.exslt.org/date/functions/...ifference.html
The template syntax is shown to be:
<xsl:call-template name="date:difference">
<xsl:with-param name="start" select="string" />
<xsl:with-param name="end" select="string" />
</xsl:call-template>
In a sample xsl file, I have:
=======================
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:date="http://exslt.org/dates-and-times" extension-element-prefixes="date">
<xsl:import href="date.difference.template.xsl" />
<xsl:template match="/">
<html>
<body>
<h2>Date Arithmetic</h2>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="date">
<br />
Date: <span style="color:#0000ff">
<xsl:value-of select="."/>; This is a duration of
<xsl:call-template name="date:difference">
<xsl:with-param name="start" select="." />
<xsl:with-param name="end" select="'20070803T00:00:00'" />
</xsl:call-template>
.</span>
<br />
</xsl:template>
</xsl:stylesheet>
================================
I have bought Beginning XML and attempting to get up-to-speed, but I think with just a little help I could get my date math implemented and move on to the other parts of my project, for which I also have a steep learning curve. Sorry for the complete newbie question.
presack
Processor: SharePoint 2003/IIS
Desktop OS: Windows XP