[OSM-dev] OSM XML Schema
michael_j at email.de
michael_j at email.de
Sun Jul 22 22:31:17 BST 2007
Hi,
The OSM API uses HTTP to transport XML-Payload between the client and server. In order to specify the structure of that payload carried e.g. in the response body of the HTTP Get method, I add XML DTD Schemas. I have used DTDs instead of other XML Schemas, as these are very good readable for humans.
E.g. the DTD for the OSM command "Get ways" looks currently as following:
<!ELEMENT osm (way*)>
<!ATTLIST osm version CDATA #REQUIRED>
<!ATTLIST osm generator CDATA #REQUIRED>
<!ELEMENT way (seg+, tag*)>
<!ATTLIST way id CDATA #REQUIRED>
<!ATTLIST way visible CDATA #IMPLIED>
<!ATTLIST way timestamp CDATA #REQUIRED>
<!ATTLIST way user CDATA #IMPLIED>
<!ELEMENT seg EMPTY>
<!ATTLIST seg id CDATA #REQUIRED>
<!ELEMENT tag EMPTY>
<!ATTLIST tag k CDATA #REQUIRED>
<!ATTLIST tag v CDATA #REQUIRED>
http://wiki.openstreetmap.org/index.php/OSM_Protocol_Version_0.4#Get_ways
I have the following questions:
1) Should we use 'NMTOKEN' instead of 'CDATA' for the attribute type definition?
2) Should the attributes defining the elements id uses the data type 'ID' instead of CDATA?
<!ATTLIST way id ID #REQUIRED>
<!ATTLIST seg id ID #REQUIRED>
As according to the XML DTD Standard it is required that all attributes marked as 'ID' are globally unique, the elements way, seg (and node) must never have the same id. Therefore I need to know, whether the database assigns IDs globally unique or just unique to each element category.
Furthermore I have added example HTTP requests to the web page. While this is very convenient, I am unsure, whether this is a risk as e.g. search engines might start crawling our OSM database for web information and thus generate server load.
Michael
PS:
I have no XML payload data for the HTTP-Put based commands. Could someone please upload examples to the wiki page.
More information about the dev
mailing list