[xquery-talk] Lookup tables or equivalent
Michael Kay
mike at saxonica.com
Tue Jan 19 13:46:36 PST 2010
index-of(("January", "February", ...), $m)
Regards,
Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay
> -----Original Message-----
> From: talk-bounces at x-query.com
> [mailto:talk-bounces at x-query.com] On Behalf Of Elliotte Rusty Harold
> Sent: 19 January 2010 12:16
> To: talk at x-query.com
> Subject: [xquery-talk] Lookup tables or equivalent
>
> Simple problem. I want an XQuery function that turns an
> English month name string such "February" into the
> equivalent number such as 2.
>
> Is there any prettier way to do this than if-then-else nested
> 12 levels deep? E.g. a switch statement or a map or some such?
>
> --
> Elliotte Rusty Harold
> elharo at ibiblio.org
> _______________________________________________
> talk at x-query.com
> http://x-query.com/mailman/listinfo/talk
More information about the talk
mailing list