bonjour
je travail sur un projet avec utilisation de langage de requête XQuery.
a partir de ma requête je doit retourné seulement une ligne mais le problème rencontré c'est que ma requête retourne tous les valeurs dans le XML
voici le contenu de mon Fichier XML
et voici mon XQuery
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47 <DominantColorFilm> <Film> <Descriptor> <SpatialCoherency>0</SpatialCoherency> <Parameters> <Percentage>41.33</Percentage> <Index>40 40 40</Index> </Parameters> <Parameters> <Percentage>14.54</Percentage> <Index>216 216 216</Index> </Parameters> <Parameters> <Percentage>9.58</Percentage> <Index>128 128 128</Index> </Parameters> <Parameters> <Percentage>6.55</Percentage> <Index>40 40 128</Index> </Parameters> <Parameters> <Percentage>6.45</Percentage> <Index>40 128 216</Index> </Parameters> <Parameters> <Percentage>5.80</Percentage> <Index>128 40 40</Index> </Parameters> <Parameters> <Percentage>5.20</Percentage> <Index>40 128 128</Index> </Parameters> <Parameters> <Percentage>2.74</Percentage> <Index>128 128 216</Index> </Parameters> <Parameters> <Percentage>2.38</Percentage> <Index>216 216 128</Index> </Parameters> <Parameters> <Percentage>2.17</Percentage> <Index>128 216 216</Index> </Parameters> </Descriptor> </Film> </DominantColorFilm>
et voici résultat de la requête
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 for $d in doc ("1055369.xml")/DominantColorFilm where $d//Index = "40 40 40" return <Information> <t>{$d//Percentage/text() } </t> <l>{$d//Index/text() }</l> </Information>
Il m'affiche tous les donnée dans le fichier XML et moi je veux affichier seulement le résultat de Index = "40 40 40"
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 <Information> <t>41.3314.549.586.556.455.805.202.742.382.17</t> <l>40 40 40216 216 216128 128 12840 40 12840 128 216128 40 4040 128 128128 128 216216 216 128128 216 216</l> </Information>
Partager