[mapserver-dev] Use of XML namespace URIs in MapServer

Kralidis,Tom [Ontario] Tom.Kralidis at ec.gc.ca
Thu Oct 1 13:58:17 EDT 2009


 

> -----Original Message-----
> From: mapserver-dev-bounces at lists.osgeo.org 
> [mailto:mapserver-dev-bounces at lists.osgeo.org] On Behalf Of 
> Daniel Morissette
> Sent: Thursday, 01 October 2009 13:43
> To: 'MapServer Dev Mailing List'
> Subject: [mapserver-dev] Use of XML namespace URIs in MapServer
> 
> Ticket http://trac.osgeo.org/mapserver/ticket/3142 raises an 
> issue about the default namespace URI used by MapServer which 
> is currently http://mapserver.gis.umn.edu/mapserver and 
> apparently this breaks some apps because this URL does not 
> resolve to anything. Docs about XML seem to say that the 
> namespace URI does not absolutely have to resolve to 
> anything, so we are still waiting to hear from the reporter 
> which apps that breaks.
> 

True.  Take, for example, the SOS 1.0.0 namespace URI of
http://www.opengis.net/sos/1.0.  Which doesn't resolve to a URL.  And
doesn't have to.

> Regardless, I thought we could simply change the default to 
> http://www.mapserver.org/mapserver but Tom wrote that some 
> parsers rely on the namespace value and this could cause a 
> backwards compatibility issue.
> 

Consider this Python snippet:

testVal =
e.find('{http://www.georss.org/georss}where/{http://www.opengis.net/gml}
Point/{http://www.opengis.net/gml}pos')

..which parses bits of a GeoRSS construct.  If the namespace changes
(even if the element name/structure stays the same), then the code has
to update to catch the new namespace, in this context.

This is where versioned namespace URIs (i.e.
http://www.opengis.net/sos/1.0) are valuable.  If a new version of a
standard is radicated, with an updated namespace URI (with version),
then existing code won't necessarily break when parsing that specific
version of the construct, which (presumably) would honour the legagy
namespace(s).  As an aside versioned namespace URIs also reduce XML
validation erros due to redefinitions (when XML schemas inherit [most of
the time indirectly] multiple versions of the same schema).


> To avoid bloating the ticket with a long discussion we 
> decided to move it here to try to come up with a plan for 
> resolution for the next beta (next week).
> 
> Here are a my questions/concerns:
> 
> - I'd be interested to hear more from XML gurus about the 
> real impact of changing the default namespace URI from 
> http://mapserver.gis.umn.edu/mapserver to 
> http://www.mapserver.org/mapserver, even if it's just for 
> consistency with our current Internet domain name.
> 
> - While checking docs on namespaces a bit, I saw several 
> examples that seem to use a different/unique URL path for 
> different XML schemas. 
> Should we not do the same, e.g. http://www.mapserver.org/wms, 
> http://www.mapserver.org/xmlmapfile, etc?
> 

We _could_, but I think that may a sledgehammer trying to crack a nut,
considering how little default MapServer namespace URIs are used across
the codebase.

..Tom


> Daniel
> --
> Daniel Morissette
> http://www.mapgears.com/
> _______________________________________________
> mapserver-dev mailing list
> mapserver-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-dev
> 


More information about the mapserver-dev mailing list