[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: upgrading Stylesheets

Subject: Re: upgrading Stylesheets
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Fri, 06 Apr 2012 10:43:06 +0100
Re:  upgrading Stylesheets
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
Saxonica

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

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.

Example:

Call a function:

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

Function:

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

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:choose>
				<xsl:when test="contains($date-part,
'Januar')">
					<xsl:value-of
select="replace($date-part, 'Januar', '01.')"/>
				</xsl:when>
				<xsl:when test="contains($date-part,
'Februar')">
					<xsl:value-of
select="replace($date-part, 'Februar', '02.')"/>
				</xsl:when>
				.
				.
				.
				<xsl:otherwise>
					<xsl:value-of
select="$date-part"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>
		
		<func:result select="replace($RetVal, '..', '.')"/>
	</func:function>

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
  {http://www.linkwerk.com/namespaces/glpcommon}ReplaceMonthToDigits()

Any suggestions?

Help would be much appreciated.


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

mailto:patrick.szabo@xxxxxxxxxxxxx
Tel.: +43 1 53452 1573
Fax: +43 1 534 52 146

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.