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