[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
> 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|