XML technologies / XSLT / XSLT 3.0 / XSLT streaming / XML sample data / OpenStreetMap
The XML datasets used here come from OpenStreetMap and were exported using the Overpass API.
There are three demonstration datasets:
Berlin_Ausschnitt.xml
Muenchen_Ausschnitt.xml
Stutgart_Mitte.xml
The XML datasets have the same structure for all three cities. They contain information such as street names, speed limits, shops, opening hours and further details accessible through OpenStreetMap. These XML files are used for Exercise 8 (Yellow Pages).
The following code example shows the file structure.
Note from the data2type editors:
As the complete demonstration datasets would be too large to include here, only a sample excerpt from one of the three files is shown.
Code example: Stuttgart_Mitte.xml (excerpt).
<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.6" generator="Overpass API">
...
<bounds minlat="48.7691" minlon="9.173" maxlat="48.7856" maxlon="9.1872"/>
...
<node id="2294018427" lat="48.7832579" lon="9.1822727" version="2" timestamp="2015-05-01T10:12:31Z" changeset="30685626" uid="287306" user="Matthias Frank">
<tag k="historic" v="memorial"/>
<tag k="note" v="Gedenktafel zur Errichtung des Stuttgarter Hauptbahnhofs"/>
<tag k="source" v="extrapolation"/>
</node>
<node id="2294018428" lat="48.7830822" lon="9.1823510" version="3" timestamp="2015-05-01T09:58:26Z" changeset="30685626" uid="287306" user="Matthias Frank">
<tag k="level" v="0"/>
<tag k="name" v="Reisebüro im Bahnhof"/>
<tag k="opening_hours" v="Mo-Fr 09:00-19:00; Sa 09:00-14:00; Su, PH off"/>
<tag k="shop" v="travel_agency"/>
<tag k="wheelchair" v="yes"/>
</node>
...
<way id="91264210" version="2" timestamp="2015-02-08T06:04:56Z" changeset="28696094" uid="12982" user="miscosm">
<nd ref="1059527186"/>
<nd ref="1059525141"/>
<nd ref="3337321162"/>
<nd ref="1059525545"/>
<nd ref="1059526563"/>
<nd ref="1059527186"/>
<tag k="addr:city" v="Stuttgart"/>
<tag k="addr:country" v="DE"/>
<tag k="addr:housenumber" v="18"/>
<tag k="addr:postcode" v="70173"/>
<tag k="addr:street" v="Hirschstraße"/>
<tag k="building" v="yes"/>
</way>
...
<relation id="2724366" version="4" timestamp="2015-01-24T15:02:12Z" changeset="28374636" uid="109062" user="Jojo4u">
<member type="way" ref="273859591" role="to"/>
<member type="way" ref="45122771" role="via"/>
<member type="way" ref="203016572" role="from"/>
<tag k="restriction" v="only_left_turn"/>
<tag k="type" v="restriction"/>
</relation>
...
</osm>
Structure of the OpenStreetMap XML files.
Line 2: OpenStreetMap element.
Line 4: The <bounds> element describes the bounding box used to select the area for export.
Line 6: The <node> elements have an ID and information about geographical position, version, author, timestamp and so on.
Line 7: The child elements <tag> provide further information about the node through key-value pairs, such as building type and opening hours.
Line 19: The <way> elements contain street information such as postal codes and house numbers, as well as references to <node> elements belonging to the element concerned.
Line 34: The <relation> elements describe connections between nodes. Examples include <way> elements that allow only left turns, or <node> elements representing stations on a railway route, and so on.
A key point about the OpenStreetMap files is that values can be accessed through key-value pairs, as in this example: <tag k="shop" v="travel_agency"/>.