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

RE: An empty sequence is not allowed as the first ar

Subject: RE: An empty sequence is not allowed as the first argument ...
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sun, 4 Jun 2006 21:14:51 +0100
you ar empty
> Mike will probably have the definitive answer on this one. 
> Given how it's now late on Friday over in the UK, however, 

Even later in France where I've been taking a holiday...
> 
> How about having a wrapper function that will accept any 
> argument or none, and does type-checking on it before calling 
> your actual formatting function? XPath 2.0 has the "castable 
> as" operator to help with this kind of thing.

It all depends what you want to happen when invalid data is encountered. If
you want anything other than a fatal error from the transformation, you have
to code in the checks yourself.

> In my XSLT 2.0 dates processing (which like yours, doesn't assume
> schema-validity) I have a function that assigns a date of Jan 1, year
> 1 to things that aren't properly dated (which means "things 
> my code can't make a date out of"). 

Two other approaches are to use the empty sequence to signify an invalid
date, and to use a union type. Union types aren't particularly well
supported - but after a week on holiday, I forget exactly what the
limitations are.

Michael Kay

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.