Re: Hesitation on setAttributeNS

Andrew Clover wrote:
> 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.

True, and the spec does mention xmlns but as a special case (which it 
is, I surely hope no other prefix-less attribute can be considered to 
have a namespace in XML :) I didn't find it clear from the text that 
setting a nsURI and no prefix was allowed.

>>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.

Yes, I'm not at all worried about that part which so far I've found rosy 
and fairly straightforward to implement.

Thanks!

-- 
Robin Berjon

Received on Wednesday, 10 December 2003 12:57:46 UTC