|
[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 valuesMichael Kay mike at saxonica.comFri Jan 4 11:11:06 PST 2008
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! 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
|






