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

Typing of parameters in XSLT 2.0

Subject: Typing of parameters in XSLT 2.0
From: Andrew Watt <andrew@xxxxxxxxxxxxxx>
Date: Wed, 16 Apr 2003 21:16:01 +0100
xslt factorial
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

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.