W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2000

Re: Namespace treatment, cloning and node.supports

From: Arnaud Le Hors <lehors@us.ibm.com>
Date: Wed, 01 Mar 2000 14:47:29 -0800
Message-ID: <38BD9E01.1BE966FD@us.ibm.com>
To: "www-dom@w3.org" <www-dom@w3.org>
"Dieter Köhler" wrote:
>  
> Nevertheless we should be more aware of XML-wellformedness, since
> namespaces are semantic sugar on XML.

It's not really a matter of XML wellformedness but rather a namespace
wellformedness. A document with an undeclared namespace prefix in it
could still be wellformed according to XML 1.0.

> Your folks can do their
> serialization by first using the URI as the prefix and then replacing
> the prefix by a shorter version (Delphi example):
> 
> element.setAttributeNS('thisIsOurVeryVeryLongURI',
>                        'thisIsOurVeryVeryLongURI:a',
>                        'value');

Actually, in general, this would not work since your URI is most likely
not going to be a valid XML name.

> 
> I demand covering (1), too.  Beside the methods for namespace
> treatment all operations on the DOM tree are as conservative as
> possible by raising exceptions, if one tries to manipulate the
> document tree in a way that violates its wellformedness.
> Unfortunately the namespace methods give up that principle for almost
> no gain.

Whether it's for no gain or not is actually the real question. If you
stick with the principal that namespace prefixes only are syntactic
sugar it is a real advantage not to have to bother with them at all and
completely rely on the serializer to set them and declare them as
necessary.
And I would argue that while the DOM implementation doesn't indeed
enfore namespace wellformedness it doesn't prevent you from doing it at
the application level.
-- 
Arnaud  Le Hors - IBM Cupertino, XML Technology Group
Received on Wednesday, 1 March 2000 17:48:05 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:47 GMT