xsl-list
[Top] [All Lists]

Re: RE: Problem with date:add

2006-02-16 03:11:40
Given this XML file

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="date_add.xsl"?>
<root CurrentDateTime="2006-02-16T09:42:00">
  <something/>
</root>

and this stylesheet

<?xml version="1.0" encoding="UTF-8"?>
<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.add.template.xsl"/>

<xsl:output method="html" />

<xsl:template match="/">
  <xsl:call-template name="date:add">
    <xsl:with-param name="date-time" select="root/@CurrentDateTime" />
    <xsl:with-param name="duration" select="'-P30D'" />
  </xsl:call-template>
</xsl:template>

</xsl:stylesheet>

I get correct results both with Saxon b 8.6.1 and IE 6.

Regards,
Mukul

On 2/16/06, Andrew Smith <andrew(_dot_)smith(_at_)itility(_dot_)co(_dot_)uk> 
wrote:
Thanks for the replies, I've changed the XSLT so that the duration is
inside single quotes, so the new code now looks like this
(/root/@CurrentDateTime contains the current date and time in the valid
format, 2006-02-16T09:42:00 at the moment)

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>