I am unable to use any of the date functions. I keep receiving errors along the lines of :
expr.SetContext(ctxt)' threw an exception of type 'System.Xml.XPath.XPathException'base {System.SystemException}: {"Extension function not found: add"}Message: "Extension function not found: add"
Here is the source code that reproduces it when clean installed (adapted from this MSDN article, with a new date field called launchedDate added)
public
{
Thanks Oleg, that did the trick,
The other question I had was to do with the data type the method returns. You get back a duration data type, which is very nice, however functions for manipulating Duration's are only available in XPath 2.0. What I wanted to do is if the duration is greater than 4 days, then do something.
The function days-from-duration would be ideal. How do you deal with duration data types without these kind of functions?
Is it the intention of MvpXml to include some XPath 2.0 functionality or only EXSLT?
I believe you can use date:seconds() to compare durations, something like this:
<xsl:if test="date:seconds($my-duration) > date:seconds('P4D')">way too long</xsl:if>
Haven't tested it though.
About XPath 2.0 - yes, there are plans to include bits of XPath 2.0 and XSLT 2.0, but one piece at a time as we have really limited developer resources.