Spectral Data Model V2.0 working draft

Norman Gray norman at astro.gla.ac.uk
Sun Oct 21 10:21:17 PDT 2012


Markus, hello.

On 17 Oct 2012, at 08:59, Markus Demleitner <msdemlei at ari.uni-heidelberg.de> wrote:

> This uglyness is even worse since for Utypes, there not even a
> rationale for binding *any* namespace prefix; VOTable utype
> attributes aren't QNames, i.e., a sensible XML processor will
> simply optimize away that gratuitous prefix declaration in the first
> place, so their clients will have to employ serious magic to get to
> it.
> 
> In short: It's abuse, it has always been abuse, and don't tell me you
> can't change it any more because it's been in use for years. 

Just for the record, I'll note that while what you say -- that a sensible XML processor will simply optimize away that gratuitous prefix declaration -- is true in principle, it's probably not true in practice.  No magic will be required.

I can find chapter and verse if you need it, but I think there is now an expectation that any 'sensible' XML parser will make namespace declarations available to the processor, whether or not they're used for XML element namespacing, precisely because some key W3C standards now rely on this behaviour.

It follows from that, that any application parsing an XML file will have access to these namespace declarations with high probability (or indeed probability 1.0, since the application has control over its XML parser), and so if need be the application could trivially do an internal rewrite of your example

> xmlns:ns1="http://www.ivoa.net/xml/Spectral/Spectral-2.0.xsd"
> ns1:Data.FluxAxis.Value

to any of 

http://www.ivoa.net/xml/Spectral/Spectral-2.0.xsdData.FluxAxis.Value
{http://www.ivoa.net/xml/Spectral/Spectral-2.0.xsd}Data.FluxAxis.Value
ssa:Data.FluxAxis.Value

…as required, during its normal processing of the document.

Whatever objections to this design there are, the practicalities of namespaces and prefixes are a red herring.

The only case where these remarks wouldn't apply would be if someone is 'parsing' the VOTable using something other than an XML parser (regular expressions!?), but in that case….

All the best,

Norman


-- 
Norman Gray  :  http://nxg.me.uk
SUPA School of Physics and Astronomy, University of Glasgow, UK



More information about the dm mailing list