From: Luciano Montanaro Date: Sun, 15 Jan 2012 19:42:16 +0000 (+0100) Subject: Added xmlpattern script to merge station codes X-Git-Tag: tags/0.5.0~20 X-Git-Url: https://vcs.maemo.org/git/?a=commitdiff_plain;h=6a133bc6a671c0cc3931474d18c30796dd879444;p=quandoparte Added xmlpattern script to merge station codes --- diff --git a/application/resources/stations/mergelist.xq b/application/resources/stations/mergelist.xq new file mode 100644 index 0000000..6a68d34 --- /dev/null +++ b/application/resources/stations/mergelist.xq @@ -0,0 +1,25 @@ + +{ +for $doc in ('stations.qpl') +for $station in doc($doc)//station, + $stationcode in doc('stationcodes.qpl')//station[name = $station/name] +return + +{$station/name} +{$station/pos} +{$stationcode/code} + +} +{ +for $doc in ('stations.qpl') +for $station in doc($doc)//station +let $stationcode := doc('stationcodes.qpl')//station[name != $station/name] +where +$station/name != $stationcode/name +return + +{$station/name} +{$station/pos} + +} + diff --git a/application/resources/stations/stationcodes.qpl b/application/resources/stations/stationcodes.qpl new file mode 100644 index 0000000..70f5c00 --- /dev/null +++ b/application/resources/stations/stationcodes.qpl @@ -0,0 +1,19 @@ + + + Genova Piazza Principe sotterranea + S04701 + + + Genova San Biagio + S04222 + + + Genova Voltri + S04534 + + + Torino Porta Nuova + S00219 + + +