OSM 0.6 XML Schema (XSD)

Hi,

maybe you will be interested. I wrote XML Schema, which describes XML, which I can get via REST API or by “Export” on http://www.openstreetmap.org/.

http://mars.iti.pk.edu.pl/~mfi/OSMSchema.xsd

It was tested on free AltovaXML engine (http://www.altova.com/altovaxml.html) I don’t think there is any sense to write DTD, XSD is much more flexible. I try to do my best, but it may be not perfect (e.g. I don’t care about altitude attribute for node element).

Hope it will be usefull for anyone.
Regards,
Greg

Are you sure that a relation has at least two members? I think there are some route relations (type=route, route=road) containing only one way.

Besides that, great work!

Thanks, I changed from “at least two members” to “at least one member”. If there are other things, please let me know, I am not OSM expert.

In fact, relations don’t have restrictions about members : zero is possible, just tags. They can be themselves members of other relations…

Sure, mea culpa. Changed (allowing no members elements for relation elements). Members can have type=“relation”. Thanks !

Very useful stuff, thanks! I have added elements for osmChange (create, modify, delete) and changeset to the XSD. I don’t have a proper XML editor at hand, though, so I did this by hand. JAXB parsed it fine, so it should be okay – still, use with caution :wink:

Here’s the link: http://ifgi.uni-muenster.de/~kessler/resources/OSMSchema.xsd

This is where the official, current xsd should be located. (see links from there to what files are currently available.)
https://wiki.openstreetmap.org/wiki/OSM_XML/XSD