I have the following XQUERY code in XMLSPY which runs fine.
xquery version "1.0";
<table border="1">
{
for $re in distinct-values(reviews/review/reviewer)
for $r in reviews/review
where $re=$r/reviewer
return <tr> <td>{$r/movie_title}</td> </tr>
}
</table>
Now I want to modify it as follows :
xquery version "1.0";
<table border="1">
{
<tr> <td>
for $re in distinct-values(reviews/review/reviewer)
for $r in reviews/review
where $re=$r/reviewer
return {$r/movie_title}
</td> </tr>
}
</table>
But it gives syntax error. What the second code should accomplish is that only outer for loop should create new row and new cell and inner loop should only add to that cell.