6a68d341733e45e3e9ea905d693b63d7f7ac81c9
[quandoparte] / application / resources / stations / mergelist.xq
1 <stations>
2 {
3 for $doc in ('stations.qpl')
4 for $station in doc($doc)//station, 
5     $stationcode in doc('stationcodes.qpl')//station[name = $station/name]
6 return
7 <station>
8 {$station/name}
9 {$station/pos}
10 {$stationcode/code}
11 </station>
12 }
13 {
14 for $doc in ('stations.qpl')
15 for $station in doc($doc)//station
16 let $stationcode := doc('stationcodes.qpl')//station[name != $station/name]
17 where
18 $station/name != $stationcode/name
19 return
20 <station>
21 {$station/name}
22 {$station/pos}
23 </station>
24 }
25 </stations>