|
[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message] HashesBrian Maso brian at blumenfeld-maso.comWed Sep 20 14:49:37 PDT 2006
How's about
define variable $animals as (
<a>aardvark</a>,
<b>bandicoot</b>,
...
)
(: and then later... :)
$animals/a
At 01:09 PM 9/20/2006, you wrote:
>Sometimes I wish that XQuery had hashes:
>
>Clunky XQuery 1.0 way:
>
>if ($n = "a") then "aardvark"
>else if ($n = "b") then "bandicoot"
>...
>else if ($n = "z") then "zebra"
>else ()
>
>Declunked way:
>
>define variable $animals as xqy:hash {
> "a" => "aardvark", "b" => "bandicoot", ... , "z" => "zebra"
>}
>
>$animals[$n]
>
>
>
>Best
>
>Tim Finney
>
>
>_______________________________________________
>http://x-query.com/mailman/listinfo/talk
>http://x-query.com/mailman/listinfo/talk
|
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
|






