Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Scope of namespaces

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: "Michael Kay" <mike AT saxonica.com>
  • To: "'Elliotte Harold'" <elharo AT metalab.unc.edu>, "'peter murray-rust'" <pm286 AT cam.ac.uk>
  • Cc: 'xom-interest' <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] Scope of namespaces
  • Date: Mon, 6 Feb 2006 10:20:02 -0000


> OK. This is weird. What's the use case? Why do you need to know if a
> particular namespace URI is in scope for some prefix irrespective of
> some particular prefix? I can't say I've ever needed to do that.

I have come across XML vocabularies in which the presence of a namespace
declaration for a particular URI carries semantics - such as telling you
which version of the spec the document conforms to - irrespective of the
fact that the prefix bound to that URI is never used within the document,
either in element or attribute names or in content.

(There are other weird things as well, for example LDML [1]: this actually
*requires* the namespace declaration to appear on a particular element (one
which doesn't use the declared namespace): putting the declaration on an
ancestor element, or on a descendant which does use the prefix, isn't good
enough. For this use case, the "declared namespaces" model is probably
better.)

You can hate namespaces all you like, but you can't make them go away, or
make them less weird.

Michael Kay
http://www.saxonica.com/

[1] http://www.unicode.org/reports/tr35/ - section 5.1







Archive powered by MHonArc 2.6.24.

Top of Page