Support of xpath-functions

Dec 11, 2014 at 9:41 AM
Great too see a new version after many years!
This version is built upon the 4.0 framework, but doens't support 'http://www.w3.org/2005/xpath-functions' namespace while transforming XML.

Error Transforming XML
Cannot find a script or an extension object associated with namespace 'http://www.w3.org/2005/xpath-functions'.

In the regular .NET 4.0 framework it does support this, so how come?

Thanks.
Coordinator
Dec 14, 2014 at 9:22 PM
I'm not aware of .NET 4.0 supporting those XPath 2.0 functions. Can you post a link to a sample stylesheet that uses these functions and the C# code that transforms it, then I will figure out how to include that in XML Notepad. Thanks.
Dec 15, 2014 at 7:39 AM
I cannot provide links to te code I use, but here's a snippet, in particular the fn namespace and function:

<?xml version='1.0' encoding='UTF-8'?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
__xmlns:fn="http://www.w3.org/2005/xpath-functions"__
version="2.0">
.....
<xsl:if test="fn:days-from-duration(fn:current-date() - xs:date(@dateChange)) = 0">
....
</xsl:stylesheet>

The C# code uses the Saxon compiler, which is why the transformation works. With the standard XSLT tranformation is doesn't.
Perhaps a good idea to use the Saxon compiler instead?
Coordinator
Dec 15, 2014 at 8:48 PM

Ok, you are using Saxon, so that makes sense. XML Notepad is not setup to use that compiler, but I could work on a “plugin” feature that allows you to plug in different XSLT engines… I’ll added a work item to the list of open issues, see:
https://xmlnotepad.codeplex.com/workitem/25872

-Chris.

Marked as answer by clovett on 4/25/2016 at 1:39 PM