[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message]

Hashes

Tim Finney tjf2n at virginia.edu
Thu Sep 21 10:22:13 PDT 2006


  Hashes
Thank you all for your replies. I now see that XQuery can do what I want
already.

Tim Finney

On Wed, 2006-09-20 at 20:31 -0400, Liam Quin wrote:
> On Wed, Sep 20, 2006 at 04:09:33PM -0400, Tim Finney wrote:
> > Sometimes I wish that XQuery had hashes:
> > 
> > Clunky XQuery 1.0 way:
> > 
> > if ($n = "a") then "aardvark"
> > else if ($n = "b") then "bandicoot"
> 
> As others have said, use XML to store structured data,
> 
> let $hash := <hash>
>   <value key="a">aardvark</value>
>   <value key="b">bandicoot</value>
> </hash>
> 
> and then,
>     $hash/hash/value[@key = "a"]
> 
> I always thought that XQuery should use this sort of thing for dates --
> $date/month, and so forth -- and that this would encourage implementations
> to do some smarter optimization for the case when people used XML to
> hold values in this way.  But oh well... maybe one day :-)
> 
> Liam
> 



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-2007 All Rights Reserved.