Discussion:
'year-from-date()' is an unknown XSLT function
(too old to reply)
Jon Paal
2006-02-23 06:55:36 UTC
Permalink
getting error message of:
'year-from-date()' is an unknown XSLT function



can anyone help with getting date parts from "$sortFieldName" before sorting.


<xsl:template match="level2">
<xsl:variable name="sortYear" select="year-from-date('$sortFieldName')"/>
<xsl:variable name="sortMonth" select="month-from-date('$sortFieldName')"/>
<xsl:variable name="sortDay" select="day-from-date('$sortFieldName')"/>

<xsl:for-each select="level2">
<xsl:sort select="$sortYear" order="ascending"/>
<xsl:sort select="$sortMonth" order="ascending"/>
<xsl:sort select="$sortDay" order="ascending"/>
<level2>
......
</level2>
</xsl:for-each>
</xsl:template>
George Bina
2006-02-23 09:41:00 UTC
Permalink
Hi,

year-from-date is an XPath 2.0 funtion, see:
http://www.w3.org/TR/xquery-operators/
and you probably are using an XSLT 1.0/XPath 1.0 processor.

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Jon Paal
2006-02-23 16:46:48 UTC
Permalink
how do I enable 2.0 ?
Post by George Bina
Hi,
http://www.w3.org/TR/xquery-operators/
and you probably are using an XSLT 1.0/XPath 1.0 processor.
Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Martin Honnen
2006-02-23 17:02:39 UTC
Permalink
Post by Jon Paal
how do I enable 2.0 ?
XSLT/XPath 2.0 are not yet W3C recommendations, they are on their way to
become specifications. Microsoft so far does not have any products
trying to implement XSLT/XPath 2.0 while the specification is being
developed.

So "enabling" 2.0 is not something that is possible in the XSLT
processors around that implement XSLT 1.0.

One implementation of XSLT 2.0/XPath 2.0 as those specification are
being developed is Saxon 8, see
<http://www.saxonica.com/>

In a stylesheet you simply need e.g.
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.0"
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Loading...