Re: Namespace treatment, cloning and node.supports

"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 UTC