Re: The "real" reason why xmlns should "not" be used

On 12 Aug 2009, at 05:24, Martin McEvoy wrote:

> <div xmlns:dc="http://purl.org/dc/elements/1.1/">
>   <h2 property="dc:title">The trouble with Bob</h2>
>   <h3 property="dc:creator">Alice</h3>
>   ...
> </div>
>
> The above example is invalid because it declares the div having a  
> prefix of dc: example:
>
> <dc:div xmlns:dc="http://purl.org/dc/elements/1.1/">
>   <h2 property="dc:title">The trouble with Bob</h2>
>   <h3 property="dc:creator">Alice</h3>
>   ...
> </dc:div>


No Martin, that's not how the default namespace (which <div> is in)  
works. xmlns="..." sets the default namespace, so would have an  
effect on the meaning of <div>. xmlns:dc="..." sets an explicitly  
prefixed namespace, so has no effect on the meaning of the <div>  
element.

-- 
Toby A Inkster
<mailto:mail@tobyinkster.co.uk>
<http://tobyinkster.co.uk>

Received on Wednesday, 12 August 2009 07:59:06 UTC