Modify

Opened 12 years ago

Closed 12 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 12 years ago.

Download all attachments as: .zip

Change History (10)

Changed 12 years ago by Don-vip

Attachment: maps.xsd added

comment:1 Changed 12 years ago by 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.

comment:2 in reply to:  1 Changed 12 years ago by stoecker

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 Changed 12 years ago by stoecker

In [4440/josm]:

added maps xsd (see #6859)

comment:4 Changed 12 years ago by stoecker

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

comment:5 Changed 12 years ago by stoecker

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

comment:6 in reply to:  description Changed 12 years ago by bastiK

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 Changed 12 years ago by Don-vip

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

comment:8 Changed 12 years ago by bastiK

In [4449/josm]:

fix schema (see #6859)

comment:9 Changed 12 years ago by stoecker

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.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.