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

RE: casting string as integer or double

Subject: RE: casting string as integer or double
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 1 May 2007 00:14:48 +0100
RE:  casting string as integer or double
> I'm using Saxon 8, and get the following error msg:
> Fatal Error! An empty sequence is not allowed as the value in 
> 'cast as' expression
> 
> I know that the value is not empty but a whole number.

Note that the two expressions

(a) $x cast as xs:integer
       
(b) xs:integer($x)

are almost synonyms, except that if $x is an empty sequence, (a) will fail
with the error message you reported, while (b) will succeed, returning an
empty sequence.

If the Saxon message says that the value is an empty sequence and you think
it isn't, then you'll need to provide some evidence for your belief.

Michael Kay
http://www.saxonica.com/

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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

Buy Stylus Studio Now

Cast Your Vote

We need your help – Vote for DataDirect XML Products!

  • Best SOA or XML site

Winners and finalists announced at SOA World Conference in November.

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-2007 All Rights Reserved.