[xsl] Typing of parameters in XSLT 2.0

Subject: [xsl] Typing of parameters in XSLT 2.0
From: Andrew Watt <andrew@xxxxxxxxxxxxxx>
Date: Wed, 16 Apr 2003 21:16:01 +0100
I was experimenting in Saxon 7.4 with a simple factorial example which accepts an argument from the command line.

In the absence of an as attribute or a type-information attribute on the <xsl:param> element the stylesheet seemed to behave in XSLT 2.0 as it did in XSLT 1.0.

That is convenient but I am not sure that I completely understand the XSLT 2.0 processor's behaviour.

Let's say the command line was java -jar saxon7.jar ..... number=5.

What type is the supplied parameter 5 in XSLT 2.0? I couldn't find a clear description in the spec.

Is the supplied parameter a string which is then automatically cast to an XPath 1.0 number?

In the processing of the $number parameter and the variable(s) used to recursively calculate the factorial it was being treated as some type of number, since I could perform both subtraction and multiplication on it. An XPath 1.0 number? Or an xsd:integer??

In the absence of both an as attribute and a type-information attribute is an XSLT 2.0 processor expected to produce the same behavior as in XSLT 1.0 and automatically treat parameters "intuitively"? Or is the Saxon 7.4 behaviour a carry over from its XSLT 1.0 heritage?

Andrew Watt



XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list


Current Thread