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: |
Attachments (1)
Change History (10)
Changed 12 years ago by
comment:1 follow-up: 2 Changed 12 years ago by
comment:2 Changed 12 years ago by
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:4 Changed 12 years ago by
The URI-Type must be changed, as our patterned URI's aren't recognized as valid.
comment:5 Changed 12 years ago by
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 Changed 12 years ago by
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:9 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
I added the XSD checks to the Maps page.
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.