Modify

Opened 13 years ago

Closed 13 years ago

#6859 closed enhancement (fixed)

Imagery providers XSD

Reported by: Don-vip Owned by: team
Priority: normal Milestone:
Component: Core Version: latest
Keywords: Cc:

Description

Hi,

I have written the XML Schema for Maps.

I think it should be first put somewhere on the SVN and linked from Maps.
This would allow everyone to perform a manual validation. It could also be used directly by JOSM, what do you think ?

Attachments (1)

maps.xsd (19.3 KB ) - added by Don-vip 13 years ago.

Download all attachments as: .zip

Change History (10)

by Don-vip, 13 years ago

Attachment: maps.xsd added

comment:1 by bastiK, 13 years ago

We can let the server validate any change to the wiki page https://josm.openstreetmap.de/wiki/Maps and reject changes, that do not pass.

in reply to:  1 comment:2 by stoecker, 13 years ago

Replying to bastiK:

We can let the server validate any change to the wiki page https://josm.openstreetmap.de/wiki/Maps and reject changes, that do not pass.

I already thought about that, as I broke the page sometimes in last days :-)

comment:3 by stoecker, 13 years ago

In [4440/josm]:

added maps xsd (see #6859)

comment:4 by stoecker, 13 years ago

The URI-Type must be changed, as our patterned URI's aren't recognized as valid.

comment:5 by stoecker, 13 years ago

Example validator code:

from lxml import etree

maps = open("maps", "r").read()

try:
  mapsxml = etree.fromstring(maps)
  schema = etree.XMLSchema(etree.parse(open("maps.xsd", "r")))
  schema.assertValid(mapsxml)
except Exception, e:
  print e

in reply to:  description comment:6 by bastiK, 13 years ago

Replying to Don-vip:

I have written the XML Schema for Maps.

I think it should be first put somewhere on the SVN and linked from Maps.
This would allow everyone to perform a manual validation. It could also be used directly by JOSM, what do you think ?

I'm not an expert in XML Schema, but can we replace <xs:sequence> by <xs:all> in line 590? It is silly to keep these properties in a special order.

An automatic validation in JOSM might not be a good idea at the moment, because the format is not stable. New properties may be added and although older versions of JOSM work fine (by ignoring the new properties) the new xml won't be valid according to the old schema. A message to the console would be ok, though.

comment:7 by Don-vip, 13 years ago

I'm not an expert either, you can of course switch to xs:all :)

comment:8 by bastiK, 13 years ago

In [4449/josm]:

fix schema (see #6859)

comment:9 by stoecker, 13 years ago

Resolution: fixed
Status: newclosed

I added the XSD checks to the Maps page.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.