Opened 20 months ago
Closed 20 months ago
#6859 closed enhancement (fixed)
Imagery providers XSD
| Reported by: | Don-vip | Owned by: | team |
|---|---|---|---|
| Priority: | normal | Component: | Core |
| Version: | latest | Keywords: | |
| Cc: |
Attachments (1)
Change History (10)
Changed 20 months ago by Don-vip
comment:1 follow-up: ↓ 2 Changed 20 months ago by bastiK
comment:2 in reply to: ↑ 1 Changed 20 months 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 20 months ago by stoecker
In [4440/josm]:
comment:4 Changed 20 months ago by stoecker
The URI-Type must be changed, as our patterned URI's aren't recognized as valid.
comment:5 Changed 20 months 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 20 months 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 20 months ago by Don-vip
I'm not an expert either, you can of course switch to xs:all :)
comment:8 Changed 20 months ago by bastiK
In [4449/josm]:
comment:9 Changed 20 months ago by stoecker
- Resolution set to fixed
- Status changed from new to 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.