W3C home > Mailing lists > Public > www-dom@w3.org > October to December 2001

Default attributes

From: Arnaud Le Hors <lehors@us.ibm.com>
Date: Wed, 19 Dec 2001 15:16:18 -0800
Message-ID: <3C211FC2.B50E0B3E@us.ibm.com>
To: www-dom@w3.org
Hi all,

DOM Level 1 was designed to work with XML 1.0 only. XML Namespaces
didn't exist, and DTDs were the only type of grammar that was used with
XML. Because DTDs provide a simple and straightforward way of
associating default attributes with elements, the DOM Level 1 was made
so that default attributes were handled automagically by the
implementation. This included adding them on element creation as well as
adding them back on removal of specified attributes for which a default
value exists.

DOM Level 2 came out with additional support to cope with XML
Namespaces. However, because DTDs are not "namespace aware", several
issues were later found with the way namespaces interact with DTD
information in general, and default attributes in particular. Namely,
because the DOM doesn't perform any namespace binding it is unclear how
default attributes should be updated in cases where the qualified name
of an element or an attribute is changed, through the change of its

Now, with the introduction of XML Schemas, the task has become even more
challenging. One might like the DOM implementation to have a similar
behavior with regard to default attributes, but with XML Schemas the
name and namespace URI of an element are not even enough to specify its
type. The type of an element may vary according to its position in the

The three put together creates a level of complexity that makes it
basically impossible to define something that would be understandable by
both users and implementors, and it is believed that it will in any case
be error prone, both at the level of the spec and the implementations. 

As an alternative, the Working Group is considering backing off from the
currently defined behavior and specify in DOM Level 3 that attributes
are not updated dynamically as the tree is being mutated but instead are
only updated according to the governing grammar at specific times.
Specifically at the time the normalizeDocument() method is called.

We do realize, however, that this change would introduce some backward
incompatibility with the previous versions of the DOM. We would
therefore appreciate feedback from others on whether this is seen as too
disruptive or whether the gain in simplicity and better interoperability
is worth this breakage.

Thanks in advance for your input.
Arnaud  Le Hors - IBM, XML Standards Strategy Group / W3C AC Rep.
Received on Wednesday, 19 December 2001 18:16:42 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:09 UTC