[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] upgrading Stylesheets

Subject: Re: [xsl] upgrading Stylesheets
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Fri, 06 Apr 2012 10:43:06 +0100

Changing the version number doesn't suddenly turn your XSLT 1.0 processor into a 2.0 processor. But you do seem to have switched processor as well.

I think the problem is that your stylesheet is using features which aren't defined in either the 1.0 or the 2.0 specification: func:function and func:result look like an EXSLT extension to XSLT 1.0 that was a precursor to xsl:function in the 2.0 specifications. It's likely that your 2.0 processor doesn't support this extension.

Michael Kay

On 06/04/2012 08:03, Szabo, Patrick (LNG-VIE) wrote:

I have a bunch of stylesheets that I want to upgrade from 1.0 to 2.0.
So I just changed the version number in the sheet and wanted to debug
from there.
We have one stylesheet that is imported into all of the stylesheets
which imports even more stylesheet where common functions are stored.

Now in 1.0 that worked fine.
Now all of a sudden I get an error that none of the functions there are
found anymore.


Call a function:

<xsl:variable name="NormMonth"
select="replace(glpc:ReplaceMonthToDigits($Date), ' ')"/>


<func:function name="glpc:ReplaceMonthToDigits">
	<xsl:param name="date-part" select="/.."/>
	<func:result select="misc:ReplaceMonthToDigits($date-part)"/>

It calls nother function which is in a different stylesheet:

<func:function name="misc:ReplaceMonthToDigits">
		<xsl:param name="date-part" select="/.."/>		
		<xsl:variable name="RetVal">
				<xsl:when test="contains($date-part,
select="replace($date-part, 'Januar', '01.')"/>
				<xsl:when test="contains($date-part,
select="replace($date-part, 'Februar', '02.')"/>
		<func:result select="replace($RetVal, '..', '.')"/>

Now both of the stylesheets are imported in the same stylesheet so they
should "find each other" right ?
Yet I get this error:

XPST0017: XPath syntax error at char 40 on line 282 in
{...placeMonthToDigits($Date), ...}:
    Cannot find a matching 1-argument function named

Any suggestions?

Help would be much appreciated.

. . . . . . . . . . . . . . . . . . . . . . . . . . Ing. Patrick Szabo XSLT Developer LexisNexis A-1030 Wien, Marxergasse 25

Tel.: +43 1 53452 1573
Fax: +43 1 534 52 146

Current Thread