XSLT Function AddDays

Adds a specified number of days to a date.

NAMESPACE

xmlns:AS="http://schema.advantages.cz/AsapFunctions"

SYNTAX

string AddDays(string date, string days)

PARAMETERS

Name Description
date Date to which days will be added.
days Number of days to be added (if negative, days will be deducted).

REMARKS

If the date has a time part, the time part is not touched.

EXAMPLE

This example adds 1 day to a source date.
Source XML

<ROOT>
    <test date="2012-03-23"/>
</ROOT>

Stylesheet

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
    xmlns:AS="http://schema.advantages.cz/AsapFunctions"
    xmlns:date="http://exslt.org/dates-and-times"
    exclude-result-prefixes="AS date">
    <xsl:template match="/">
        <test test="{AS:AddDays(/ROOT/test/@date, 1)}"/>
    </xsl:template> 
</xsl:stylesheet>