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

XSLT 2.0 and external parameters: a string -> xsd:inte

Subject: XSLT 2.0 and external parameters: a string -> xsd:integer. How?
From: Andrew Watt <andrew@xxxxxxxxxxxxxx>
Date: Tue, 20 May 2003 19:03:03 +0100
xslt external parameter
I guess this is another angle on the typing questions that have been floating around the list recently.

Code that worked with Saxon 7.4 (and that I think would work in XSLT 1.0) is now broken with Saxon 7.5.

How can I supply an external parameter to a Saxon 7.5 stylesheet which is $number and has an integer value and get the XSLT processor to treat it as an xsd:integer. Well, I don't particularly want the parameter to be xsd:integer but I assume I won't be able to do anything numeric with it, unless I make it explicitly numeric.

If I try to ignore types altogether Saxon 7.5 complains, not surprisingly, that it cannot compare xsd:string to xsd:integer. If there is a way to write a type-agnostic stylesheet to accept a parameter that is intended to be numeric it isn't obvious to me at the moment.

So I made the input parameter xsd:string and created a new numeric parameter using the xsd:integer() constructor function. Same error message.

Then I tried making the input parameter xdt:untypedAtomic with the xsd:integer() constructor function to create the second parameter. Same error message.

Then I tried adding an as="xsd:integer". Same error message.

The Saxon 7.5 documentation indicates that "most" such functions are supported. Is this one unsupported or am I missing a basic trick somewhere?

I want to input a parameter at the command line, .... number=3 (which is presumably a string at the point where it is bound to a global parameter (which I have called $string), and later use that value (with $number constructed using xsd:integer($string) ) as an xsd:integer.

How can that be done?

Thanks

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.