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

Defining a string array and setting values

Michael Kay mike at saxonica.com
Fri Jan 4 11:11:06 PST 2008


  Defining a string array and setting values
It looks to me as if you are guessing, and if you're assuming that XQuery
will behave like procedural languages that you may have encountered in the
past. That's not a good way to approach a new language: you will only find
yourself frustrated if you try to learn by trial and error.
 
Firstly, take the time to study the XQuery data model. You will find that it
doesn't have arrays, it has sequences.
 
Also, XQuery is a declarative language, so you can't update variables.
 
The way you initialize a global variable to a sequence of strings is
 
declare variable $e as xs:string* := {$x, $y, $z, $u};
 
Michael Kay
http://www.saxonica.com/


  _____  

From: http://x-query.com/mailman/listinfo/talk [mailto:http://x-query.com/mailman/listinfo/talk] On Behalf
Of Jayalakshmy K
Sent: 04 January 2008 04:28
To: http://x-query.com/mailman/listinfo/talk
Subject:  Defining a string array and setting values



I want to declare a string array and set values to it in a function 

how do i do it using XQuery. Itried using this but it didn't work 
declare variable $errorParam:= ""; 
        $errorParam[.= 0] = $x 
        $errorParam[.= 1] = $y 
        $errorParam[.= 2] = $z 
        $errorParam[.= 3] = $w 
        $errorParam[.= 4] = $u 



______________________________________________________________________


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://x-query.com/pipermail/talk/attachments/20080104/5601412c/attachment.htm


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.