Re: question regarding Element.getAttributeNS()

Garret Wilson wrote:
> No? Let me give a useful example:
> 
> <html xmlns=".../w3/xhtml/..." xmlns:xhtml=".../w3/xhtml/...">
> ...
> <img src="image1.jpg" />
> <img xhtml:src="image2.jpg" />
> 
> This document, while a bit silly, is as far as I can tell a completely valid
> XHTML document (ignoring the missing pieces). Both <img> src and <img>
> xhtml:src refer to the same attribute in the schema, right? (This, I
> suppose, is my big assumption.)

No they are not. The XHTML spec defines the src attribute for the img element
in the XHTML namespace but it does not define the src attribute in the namespace
XHTML.

> If one wants to correctly interpret all XHTML documents, then, one must
> search both for <img> src and <img> xhtml:src, even though they are in
> different namespaces, because someone *can* create such a document and it
> will be correct. (XHTML is just an example -- this applies to any schema, I
> would think.)

This is the same for SMIL, SVG or MathML. For an example of attributes defined
in a particular namespace, see the XLink specification.

Received on Friday, 22 December 2000 11:21:09 UTC