Re: Hesitation on setAttributeNS

Andrew Clover wrote:
> Robin Berjon <robin.berjon@expway.fr> wrote:
>>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.
> 
> Ah! I see what you mean properly now. :-)
> 
> As I read it, the prefix of an Attr node is, in the face of namespace
> normalisation, not fixed, so it makes sense that a non-namespace-well-formed
> situation (namespace w/ null prefix) should be allowed to exist temporarily
> - it could be used by authors to create attributes in a namespace without
> caring what prefix will later be used in the serialisation.
> 
> My interpretation, anyway.

Yes, I agree that having the prefix as an indication of what the author 
would like to see used that may eventually be something different (if 
two attributes with the same prefix but different namespaces are set on 
the same element) or that may be absent to let the implementation make a 
reasonable choice is a good feature. But as you say, the text around the 
method more or less leaves that up to interpretation, having it spelt 
out would be nicer and more conducive to interoperable implementations.

-- 
Robin Berjon

Received on Wednesday, 10 December 2003 14:57:05 UTC