<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi,<div><br></div><div>like David, I also think this is a bug. For example for the query</div><div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><span style="color: #2f00c1">declare</span> <span style="color: #2f00c1">variable</span> $<span style="color: #f91813">seq</span> := (&lt;<span style="color: #008a00">A</span>&gt;&lt;<span style="color: #008a00">a1</span>/&gt;&lt;<span style="color: #008a00">a2</span>/&gt;&lt;/<span style="color: #008a00">A</span>&gt;, &lt;<span style="color: #008a00">B</span>&gt;&lt;<span style="color: #008a00">b1</span>/&gt;&lt;/<span style="color: #008a00">B</span>&gt;);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><span style="color: #2f00c1">for</span> $<span style="color: #f91813">i</span> <span style="color: #2f00c1">in</span> 1 <span style="color: #2f00c1">to</span> 2 <span style="color: #2f00c1">return</span> ($<span style="color: #f91813">seq</span>[$<span style="color: #f91813">i</span>], $<span style="color: #f91813">seq</span>[$<span style="color: #f91813">i</span>]/*)</div></div></div><div><br></div><div>, zorba would return something like</div><div><br></div><div><div><font class="Apple-style-span" face="Arial, Helvetica, sans-serif" size="4"><span class="Apple-style-span" style="font-size: 14px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px;"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; ">&lt;<span style="color: #008a00">A</span>&gt;&lt;<span style="color: #008a00">a1</span>/&gt;&lt;<span style="color: #008a00">a2</span>/&gt;&lt;/<span style="color: #008a00">A</span>&gt;&lt;<span style="color: #008a00">a1</span>/&gt;&lt;<span style="color: #008a00">a2</span>/&gt;&lt;<span style="color: #008a00">B</span>&gt;&lt;<span style="color: #008a00">b1</span>/&gt;&lt;/<span style="color: #008a00">B</span>&gt;&lt;<span style="color: #008a00">b1</span>/&gt;</div></span></font></div></div><div><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif; font-size: 14px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "><br></span></div><div>and I think this is the correct result (you can try it easily on <a href="http://try.zorba-xquery.com">http://try.zorba-xquery.com</a> ). You probably should try your query on other engines and than write a mail to the implementer of the XQuery engine you are using.</div><div><br></div><div>Best Markus</div><div><br><div><div>Am 05.11.2010 um 01:07 schrieb Vyacheslav Zholudev:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hi all,<br><br>Using one of the XQuery processors I encountered the following situation:<br><br>Assume I have a sequence of 2 XML elements: $seq := (A, B)<br>"A" contains 2 element children: a1, a1; "B" contains one element child b1<br><br>Query:<br>for $i in 1 to 2 return ($seq[$i], $seq[$i]/*)<br><br>returns<br>(A, b1, B, a1, a2)<br><br>That is for A it returns children of B, and for B it returns children of A.<br><br>Is it somehow explainable or it's a definitely a bug in the XQuery processor?<br><br>Thanks,<br>Vyacheslav<br><br><br><br>_______________________________________________<br><a href="mailto:talk@x-query.com">talk@x-query.com</a><br>http://x-query.com/mailman/listinfo/talk<br></div></blockquote></div><br></div></body></html>