-
Notifications
You must be signed in to change notification settings - Fork 0
/
xq.txt
54 lines (54 loc) · 1.49 KB
/
xq.txt
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
48
49
50
51
52
53
54
xquery version "1.0";
let $d := doc("master.xml")
return
<html>
<head>
<title>XQuery</title>
<link href="www/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="www/css/master.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="container">
<div class="content">
{
for $i in $d//intervenant
order by $i/nom
return
<div class="">
<h1>{data($i/@id)} : {data($i/nom)}</h1>
{
if($d//unite/ref-intervenant/@ref = $i/@id) then (
<h2>Enseignements</h2>,
for $j in $d//unite
where $j/ref-intervenant/@ref = $i/@id
return <p>{data($j/nom)}</p>
) else ()
}
{
if($d//specialite/responsables/ref-intervenant/@ref = $i/@id) then (
<h2>Responsable de spécialité</h2>,
for $j in $d//specialite
where $j/responsables/ref-intervenant/@ref = $i/@id
return <p>{data($j/nom)}</p>
) else ()
}
{
if($d//parcours/responsables/ref-intervenant/@ref = $i/@id) then (
<h2>Intervient dans les parcours</h2>,
for $j in $d//parcours
where $j/responsables/ref-intervenant/@ref = $i/@id
return <p>{
for $k in $d//specialite
where $k/parcours/@id = $j/@id
return $k/nom
} / {data($j/nom)}</p>
) else ()
}
</div>
}
</div>
</div>
<script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"></script>
<script src="www/js/bootstrap.min.js" type="text/javascript"></script>
</body>
</html>