This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

location and use of .xsd Schema files?

0

(q1) Where is the official source of the current OSM .xsd Schema file?

Checked the Wiki and found this page as a start: https://wiki.openstreetmap.org/wiki/OSM_XML/XSD Is that it?

(q2) How do you modify the xml Export (.osm) file to reference the authoritative .xsd Schema file?

(Note: export writes a .osm file which is XML, and can easily be renamed to .xml)

Speculate you just take line 2 of the .xml file which contains this:

 osm version=... generator=... copyright=... attribution=... license=...

and add in ( ahead of the closing ">" )

 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

and

 xsi:noNamespaceSchemaLocation="OSMSchema.xsd"

Provided you have a validated copy of the current OSM .xsd file named OSMSchema.xsd and its located in the same directory.

asked 17 Feb '15, 14:23

rjl's gravatar image

rjl
30224
accept rate: 0%

1

Can you explain in a little more detail what it is that you are actually trying to do?

(17 Feb '15, 14:31) SomeoneElse ♦

Trying to get .osm to load and validate against authoritative .xsd . OSMSchema.xsd (that I found) has xmlns="http://openstreetmap.org/osm/0.6" and targetNamespace="http://openstreetmap.org/osm/0.6" yet .osm files don't utilize a namespace? Project otherwise seems quite mature.

(17 Feb '15, 15:08) rjl
1

This doesn't seem to be a question, or if so is largely rhetorical. Consider rephrasing it, and adding information about why you want to ask the question.

(17 Feb '15, 15:36) SK53 ♦
1

XML files are not required to contain namespace declarations.

(17 Feb '15, 15:37) scai ♦

One Answer:

6

There is no official xsd schema file, which is why it doesn't appear referenced from within the files.

There's no official schema in any other format either.

answered 17 Feb '15, 15:41

Andy%20Allan's gravatar image

Andy Allan
12.5k23128153
accept rate: 28%

Thanks. Good to know.

(17 Feb '15, 17:07) rjl

Source code available on GitHub .