Re: Hesitation on setAttributeNS

Robin Berjon <robin.berjon@expway.fr> wrote:

> whether it is legal to use it with a defined nsURI, and a qName that
> doesn't contain a prefix part.

Sure it is. For example, the element in '<a xmlns="a"/>' has a non-null
namespaceURI but no prefix. It must be possible to create the element by
DOM methods without having to create the namespace declaration attribute.

> Most implementations seem to accept it, and then fail to serialise it 
> properly.

Up until DOM Level 3, there was nothing to say how (if at all) namespace
fixup should be done in this case. This is better defined in the latest
specs (dependent on the value of the 'namespaces' parameter to
DOMConfiguration, an imp might be expected to do the fixup on serialisation
and/or normalisation), with a suggested algorithm, so imps should hopefully
become more standardised on this issue.

> or it is clearly allowed, with indication of how the implementation may
> produce the prefix

See http://www.w3.org/TR/2003/CR-DOM-Level-3-Core-20031107/namespaces-algorithms.html

-- 
Andrew Clover
mailto:and@doxdesk.com
http://www.doxdesk.com/

Received on Wednesday, 10 December 2003 12:17:26 UTC