[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Attributes with default namespaces? XSLT Rec ques

Subject: RE: Attributes with default namespaces? XSLT Rec question..
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 14 Nov 2008 09:56:46 -0000
RE:  Attributes with default namespaces? XSLT Rec  ques
> It isn't very explicit about why the default namespace does 
> not apply to attributes, though. And indeed REC-xml-names 
> itself neither.
> Is there anyone on this list who happens to know what the 
> real reasons where why that rule was added to that 
> recommendation? Not that I object, it saves typing a lot of 
> prefixes on occasion. I am just being curious. :-)

It can be hard to work out why a WG has made a decision even when you were
at the meeting. There was a lot of debate about this: I think the three
options were that unprefixed attributes should be (a) in no namespace, (b)
in the default namespace, or (c) in the namespace of the containing element.
The underlying principle is that most attributes are defined as part of the
same vocabulary as the containing element (a "vocabulary" being a unit of
design and change control). You don't want (b) because that means if you
give the element a prefix you have to give most of its attributes a prefix
too (<html:table html:width="10" html:height="30"/> gets pretty ugly). The
choice between (a) and (c) is more arbitrary, but (a) reflects that the
definition and semantics of the attribute are usually local to the element;
the fact that a height attribute is defined for an html:table element
doesn't mean you can use it (in the form html:height) on an invoice element.

This also explains the idea that "no-namespace" names are not in a namespace
- the thinking is that a namespace has a definition, it is controlled by a
design authority, whereas the no-namespace is a bucket in which anyone can
put anything. While this idea has merit, the language of a lot of
specifications would be simpler if the "no-namespace" were treated as just
another namespace that happens to have no name (or a name of "").

Michael Kay

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.