<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16587" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=314330711-04012008><FONT face=Arial 
color=#0000ff size=2>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.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=314330711-04012008></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=314330711-04012008><FONT face=Arial 
color=#0000ff size=2>Firstly, take the time to study the XQuery data model. You 
will find that it doesn't have arrays, it has sequences.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=314330711-04012008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=314330711-04012008><FONT face=Arial 
color=#0000ff size=2>Also, XQuery is a declarative language, so you can't update 
variables.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=314330711-04012008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=314330711-04012008><FONT face=Arial 
color=#0000ff size=2>The way you initialize a global variable to a sequence of 
strings is</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=314330711-04012008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=314330711-04012008><FONT face=Arial 
color=#0000ff size=2>declare variable $e as xs:string* := {$x, $y, $z, 
$u};</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=314330711-04012008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=314330711-04012008><FONT face=Arial 
color=#0000ff size=2>Michael Kay</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=314330711-04012008><FONT face=Arial 
color=#0000ff size=2><A 
href="http://www.saxonica.com/">http://www.saxonica.com/</A></FONT></SPAN></DIV><BR>
<BLOCKQUOTE 
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
  <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
  <HR tabIndex=-1>
  <FONT face=Tahoma size=2><B>From:</B> talk-bounces@x-query.com 
  [mailto:talk-bounces@x-query.com] <B>On Behalf Of </B>Jayalakshmy 
  K<BR><B>Sent:</B> 04 January 2008 04:28<BR><B>To:</B> 
  talk@x-query.com<BR><B>Subject:</B> [xquery-talk] Defining a string array and 
  setting values<BR></FONT><BR></DIV>
  <DIV></DIV><BR><FONT face="Trebuchet MS" size=2>I want to declare a string 
  array and set values to it in a function</FONT> <BR><BR><FONT 
  face="Trebuchet MS" size=2>how do i do it using XQuery. Itried using this but 
  it didn't work</FONT> <BR><FONT face="Trebuchet MS" size=2>declare variable 
  $errorParam:= "";</FONT> <BR><FONT face="Trebuchet MS" size=2>&nbsp; &nbsp; 
  &nbsp; &nbsp; $errorParam[.= 0] = $x </FONT><BR><FONT face="Trebuchet MS" 
  size=2>&nbsp; &nbsp; &nbsp; &nbsp; $errorParam[.= 1] = $y </FONT><BR><FONT 
  face="Trebuchet MS" size=2>&nbsp; &nbsp; &nbsp; &nbsp; $errorParam[.= 2] = $z 
  </FONT><BR><FONT face="Trebuchet MS" size=2>&nbsp; &nbsp; &nbsp; &nbsp; 
  $errorParam[.= 3] = $w</FONT> <BR><FONT face="Trebuchet MS" size=2>&nbsp; 
  &nbsp; &nbsp; &nbsp; $errorParam[.= 4] = $u 
  </FONT><BR><BR><BR><BR>______________________________________________________________________<BR></BLOCKQUOTE></BODY></HTML>