Merge branch 'upstream'
[routino] / xml / routino-osm.xsd
1 <?xml version="1.0" encoding="utf-8" ?>
2
3 <!-- ============================================================
4      $Header: /home/amb/routino/xml/RCS/routino-osm.xsd,v 1.2 2010/05/23 08:24:26 amb Exp $
5
6      An XML Schema Definition for the part of the OSM XML format read by Routino.
7
8      Part of the Routino routing software.
9      ============================================================
10      This file Copyright 2010 Andrew M. Bishop
11
12      This program is free software: you can redistribute it and/or modify
13      it under the terms of the GNU Affero General Public License as published by
14      the Free Software Foundation, either version 3 of the License, or
15      (at your option) any later version.
16      ============================================================ -->
17
18 <xsd:schema elementFormDefault="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
19
20   <!-- The top level osm element -->
21
22   <xsd:element name="osm" type="osmType"/>
23
24   <xsd:complexType name="osmType">
25     <xsd:sequence>
26       <xsd:element name="bounds"    type="boundsType"   minOccurs="0" maxOccurs="unbounded"/>
27       <xsd:element name="bound"     type="boundType"    minOccurs="0" maxOccurs="unbounded"/>
28       <xsd:element name="node"      type="nodeType"     minOccurs="0" maxOccurs="unbounded"/>
29       <xsd:element name="way"       type="wayType"      minOccurs="0" maxOccurs="unbounded"/>
30       <xsd:element name="relation"  type="relationType" minOccurs="0" maxOccurs="unbounded"/>
31     </xsd:sequence>
32     <!--
33     <xsd:attribute name="version"   type="xsd:string"/>
34     <xsd:attribute name="generator" type="xsd:string"/>
35     -->
36   </xsd:complexType>
37
38   <!-- The second level bounds, node, way and relation elements -->
39
40   <xsd:complexType name="boundsType">
41     <!--
42     <xsd:attribute name="minlat"    type="xsd:string"/>
43     <xsd:attribute name="minlon"    type="xsd:string"/>
44     <xsd:attribute name="maxlat"    type="xsd:string"/>
45     <xsd:attribute name="maxlon"    type="xsd:string"/>
46     <xsd:attribute name="origin"    type="xsd:string"/>
47     -->
48   </xsd:complexType>
49
50   <xsd:complexType name="boundType">
51     <!--
52     <xsd:attribute name="box"       type="xsd:string"/>
53     <xsd:attribute name="origin"    type="xsd:string"/>
54     -->
55   </xsd:complexType>
56
57   <xsd:complexType name="nodeType">
58     <xsd:sequence>
59       <xsd:element name="tag"       type="tagType" minOccurs="0" maxOccurs="unbounded"/>
60     </xsd:sequence>
61     <xsd:attribute name="id"        type="xsd:string"/>
62     <xsd:attribute name="lat"       type="xsd:string"/>
63     <xsd:attribute name="lon"       type="xsd:string"/>
64     <!--
65     <xsd:attribute name="timestamp" type="xsd:string"/>
66     <xsd:attribute name="uid"       type="xsd:string"/>
67     <xsd:attribute name="user"      type="xsd:string"/>
68     <xsd:attribute name="visible"   type="xsd:string"/>
69     <xsd:attribute name="version"   type="xsd:string"/>
70     <xsd:attribute name="action"    type="xsd:string"/>
71     -->
72   </xsd:complexType>
73
74   <xsd:complexType name="wayType">
75     <xsd:sequence>
76       <xsd:element name="nd"        type="ndType"  minOccurs="0" maxOccurs="unbounded"/>
77       <xsd:element name="tag"       type="tagType" minOccurs="0" maxOccurs="unbounded"/>
78     </xsd:sequence>
79     <xsd:attribute name="id"        type="xsd:string"/>
80     <!--
81     <xsd:attribute name="timestamp" type="xsd:string"/>
82     <xsd:attribute name="uid"       type="xsd:string"/>
83     <xsd:attribute name="user"      type="xsd:string"/>
84     <xsd:attribute name="visible"   type="xsd:string"/>
85     <xsd:attribute name="version"   type="xsd:string"/>
86     <xsd:attribute name="action"    type="xsd:string"/>
87     -->
88   </xsd:complexType>
89
90   <xsd:complexType name="relationType">
91     <xsd:sequence>
92       <xsd:element name="member"    type="memberType" minOccurs="0" maxOccurs="unbounded"/>
93       <xsd:element name="tag"       type="tagType"    minOccurs="0" maxOccurs="unbounded"/>
94     </xsd:sequence>
95     <xsd:attribute name="id"        type="xsd:string"/>
96     <!--
97     <xsd:attribute name="timestamp" type="xsd:string"/>
98     <xsd:attribute name="uid"       type="xsd:string"/>
99     <xsd:attribute name="user"      type="xsd:string"/>
100     <xsd:attribute name="visible"   type="xsd:string"/>
101     <xsd:attribute name="version"   type="xsd:string"/>
102     <xsd:attribute name="action"    type="xsd:string"/>
103     -->
104   </xsd:complexType>
105
106   <!-- The third level elements and their contents -->
107
108   <xsd:complexType name="tagType">
109     <xsd:attribute name="k"         type="xsd:string"/>
110     <xsd:attribute name="v"         type="xsd:string"/>
111   </xsd:complexType>
112
113   <xsd:complexType name="ndType">
114     <xsd:attribute name="ref"       type="xsd:string"/>
115   </xsd:complexType>
116
117   <xsd:complexType name="memberType">
118     <xsd:attribute name="type"      type="xsd:string"/>
119     <xsd:attribute name="ref"       type="xsd:string"/>
120     <xsd:attribute name="role"      type="xsd:string"/>
121   </xsd:complexType>
122
123 </xsd:schema>