Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [xsl] An empty sequence is not allowed as the first argument ...

From: "Michael Kay" <mike@------------>
To:
Date: 6/4/2006 9:09:00 PM
> 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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent