Changed generator to prioritize name:it
authorLuciano Montanaro <mikelima@cirulla.net>
Thu, 30 Jun 2011 21:49:08 +0000 (23:49 +0200)
committerLuciano Montanaro <mikelima@cirulla.net>
Thu, 30 Jun 2011 21:49:08 +0000 (23:49 +0200)
Use name:it if it is present, otherwise use name.
Fixes bilinual names in Trentino, for example.

application/resources/stations/generatelist.xq

index 68126df..a8ea64a 100644 (file)
@@ -37,11 +37,12 @@ data($node/@lat)
 data($node/@lon)
 }
 </pos>
-<name>
-{
-data($node//tag[@k='name']/@v)
-}
-</name>
+<name>{
+if (fn:exists(data($node//tag[@k='name:it']))) then
+       data($node//tag[@k='name:it']/@v)
+else
+       data($node//tag[@k='name']/@v)
+}</name>
 </station>
 }
 </stations>