bonjour
je suis entrain d'apprendre le langage de requête xquery avec les exemples du site de w3c
je me suis dit si c'est possible d'avoir le resultat suivant :
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 <bib> <book year="1994"> <title>TCP/IP Illustrated</title> <author><last>Stevens</last><first>W.</first></author> <publisher>Addison-Wesley</publisher> <price>65.95</price> </book> <book year="1992"> <title>Advanced Programming in the Unix environment</title> <author><last>Stevens</last><first>W.</first></author> <publisher>Addison-Wesley</publisher> <price>65.95</price> </book> <book year="2000"> <title>Data on the Web</title> <author><last>Abiteboul</last><first>Serge</first></author> <author><last>Buneman</last><first>Peter</first></author> <author><last>Suciu</last><first>Dan</first></author> <publisher>Morgan Kaufmann Publishers</publisher> <price>39.95</price> </book> <book year="1999"> <title>The Economics of Technology and Content for Digital TV</title> <editor> <last>Gerbarg</last><first>Darcy</first> <affiliation>CITI</affiliation> </editor> <publisher>Kluwer Academic Publishers</publisher> <price>129.95</price> </book> </bib>
donc j'ai écrit ces quelques ligne qui ne marche pas
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 <resultat> <title>TCP/IP Illustrated</title> <publisher>Addison-Wesley</publisher> <title>Advanced Programming in the Unix environment</title> <publisher>Addison-Wesley</publisher> <title>Data on the Web</title> <publisher>Morgan Kaufmann Publishers</publisher> <title>The Economics of Technology and Content for Digital TV</title> <publisher>Kluwer Academic Publishers</publisher> </resultat>
parcontre en ajoutant des balises après le return sa marche
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 { for $l in doc("http://bstore1.example.com/bib.xml")//book return {$l/title} {$l/publisher} }
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 { for $l in doc("http://bstore1.example.com/bib.xml")//book return <result> {$l/title} {$l/publisher} </result> }
mais j'aurai pas le résultat escompter, donc je me pose des questions si c'est possible ou pas
Merci de votre aide
Partager