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

An empty sequence is not allowed as the first argument

Subject: An empty sequence is not allowed as the first argument ...
From: cknell@xxxxxxxxxx
Date: Fri, 02 Jun 2006 16:02:21 -0400
xml error empty argument
I've written an XSLT function to format dates fetched from a database. This worked well until I pulled some records with NULL values for the date I wished to format. When my stylesheet encountered this element, Saxon emitted this error message and ended with a fatal error:

Fatal Error! An empty sequence is not allowed as the first argument of ck:std-date-string-fmt()

You may well ask, "What did you expect?" The answer is that I was not expecting anything. I was happily ignorant of the lurking danger. I tried to supply a default empty string value for the parameter that causes the function to choke when no value is supplied, only to be upbraided by Saxon telling me that default values are not permitted in function parameters.

(I had slipped in an xsl:choose to catch the empty-sting cases, but without being able to assign a default value, that failed.)

Does an empty sequence have some kind of xs:type that I could cast to an xs:string, and if so, how is it done? If not, how do I handle cases when no data comes from my database?
-- 
Charles Knell
cknell@xxxxxxxxxx - email

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.