Tweaked station download/generation scripts
[quandoparte] / application / resources / stations / generatelist.xq
1 <stations>
2 {
3 for $doc in ('nordovest.osm',
4              'nordest.osm',
5              'liguria.osm',
6              'centronord.osm', 
7              'centrosud.osm', 
8              'sud.osm', 
9              'sicilia.osm', 
10              'puglia.osm', 
11              'sardegna.osm')
12 for $node in doc($doc)//node
13 where $node/tag[@k='name'] and (
14 $node/tag[@k='operator'] and (
15 fn:contains($node//tag[@k='operator']/@v, 'RFI') or 
16 fn:contains($node//tag[@k='operator']/@v, 'Centostazioni') or 
17 fn:contains($node//tag[@k='operator']/@v, 'Grandi Stazioni')))
18 return 
19 <station>
20 <pos>{
21 data($node/@lat)
22 },{
23 data($node/@lon)
24 }
25 </pos>
26 <name>
27 {
28 data($node//tag[@k='name']/@v)
29 }
30 </name>
31 </station>
32 }
33 </stations>