for $variable in expression_recherche
RETURN
"for" associe à chaque $variable une valeur (fragment XML) trouvé pour l'expression XQuery (voir page 7)
for $t in //topic/title
for $t in document("catalog09.xml")//c3msbrick//c3mssoft-desc//card-propvalue
return $t
for $t in document("catalog09.xml")//c3msbrick
let $desc := $t//c3mssoft-desc//card-propvalue
return $desc
for $t in document("catalog09.xml")//c3msbrick
let $n := count($t//c3mssoft)
return <result> {$t/title/text()} possède {$n} briques </result>
for $t in document("catalog09.xml")//c3msbrick
let $n := count($t//c3mssoft)
where ($n > 1)
return <result> {$t/title/text()} possède {$n} briques </result>
for $t in //topic/title order by $t return $t
for $t in document("catalog09.xml")//c3msbrick
let $n := count($t//c3mssoft)
where ($n > 1)
order by $n
return <result> {$t/title/text()} possède {$n} briques </result>
for $t in document("catalog09.xml")//c3msbrick
let $brick_softs := $t//c3mssoft
let $n := count($brick_softs)
where ($n > 0)
order by $n
return <result>
For {$t/title/text()} we found {$n} softwares: {$brick_softs//title}
</result>
for $t in document("catalog09.xml")//c3msbrick
let $n := count($t//c3mssoft)
return <result>
{$t/title/text()} possède {$n} briques
</result>
for $t in document("catalog09.xml")//c3msbrick
let $n := count($t//c3mssoft)
return $t/title/text() possède $n briques
for $t in //c3msbrick/title
return $t
retourne une liste (une collection)
1 <title class ="- topic/title " > TECFA Seed Catalog </ title >
2 <title class ="- topic/title " > Introduction </ title >
3 <title class ="- topic/title " > Conceptual and technical framework </ title >
4 <title class ="- topic/title " > The socio-constructivist approach </ title >
....
<result>
{ for $t in //topic/title/text()
return <titre>{$t}</titre> }
</result>
<result >
<titre > TECFA Seed Catalog </ titre >
<titre > Introduction </ titre >
<titre > Conceptual and technical framework </ titre >
<titre > The socio-constructivist approach </ titre >
....
</result>
<result>
<title>List of C3MSBricks and associated Software</title>
{ for $t in document("catalog09.xml")//c3msbrick
let $brick_softs := $t//c3mssoft
let $n := count($brick_softs)
where ($n > 0)
order by $n descending
return
<brick> Pour {$t/title/text()} on a les {$n} modules suivants:
{ for $soft in $brick_softs
return <soft> {$soft//title/text()}</soft>
}
</brick>
}
</result>
<result >
<title > List of C3MSBricks and associated Software </ title >
<brick > Gallery possède les 5 briques suivants:
<soft > PhotoShare </ soft >
<soft > Photoshare combined with PageSetter </ soft >
<soft > My_eGallery </ soft >
<soft > Coppermine </ soft >
<soft > Gallery </ soft >
</ brick >
<brick > User statistics possède les 5 briques suivants:
<soft > commArt </ soft >
<soft > pncUserPoints </ soft >
<soft > pncSimpleStats </ soft >
<soft > Statistics module </ soft >
<soft > NS-User_Points </ soft >
</ brick >
.....
</result>