W3C home > Mailing lists > Public > xmlschema-dev@w3.org > August 2007

RE: Why does the default namespace not apply to attributes?

From: Michael Kay <mike@saxonica.com>
Date: Mon, 20 Aug 2007 13:31:52 +0100
To: "'Nanda Kol'" <nandakol@hotmail.com>, <noah_mendelsohn@us.ibm.com>
Cc: <xmlschema-dev@w3.org>
Message-ID: <037801c7e326$16c79730$6401a8c0@turtle>
 > Please, don't misunderstand my question; it is absolutely not my
intention to suggest changes to the XML spec, rather my aim is to to find
out what is the rationale for the difference between elements and attributes
with regard to the default namespace. 
 
The rationale, I think, is that attributes normally have meanings and
definitions that are local to the element in which they appear; when that is
the case, putting them in a namespace serves no useful purpose.
 
Of course it's also sometimes true that child elements have meanings and
definitions that are local to the parent element in which they appear; and I
think that's why the XML Schema spec allows the option
elementFormDefault="unqualified". In practice though I think this option is
rarely used and certainly is rarely recommended. The most common practice is
to put child elements in the same namespace as their parents.
 
One could argue this is inconsistent - but if there were no differences
between elements and attributes then there would be no point in XML
providing both.
 
Michael Kay
http://www.saxonica.com/
Received on Monday, 20 August 2007 12:32:06 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:15:00 GMT