Re: Response to comment on Namespaces in XML 1.1

> Does this solve the confusion on inheriting namespaces?

No change has been made to the rules for inheriting namespaces, except
the ability to undeclare prefixes, which is a separate issue.  There
is no possibility of changing the rules, since it would break millions
of existing documents and is not within the scope of this revision to
the spec.

> The most logical approach, for any developer of any language, is that
> an element or attribute is, by default, in the namespace of the
> parent's scope unless specified otherwise.  From what I understand,
> this is true for elements/nodes, but not for attributes.

No, it is not true for either.

> For example, the intuitive approach would say:
>	<html:html...>
>		<a href="..."/>
>	</html:html>
> that the "a" node is in the 'html' namespace (or the URI pointed to
> by that name), and that the "href" attribute is an attribute of the
> "a" node

No, the "a" element is in no namespace (unless there is a default
namespace declaration you have not shown), and this will not do what
you want.  In fact, the situation for attributes is closer to what you
think is intuitive in that although the href attribute is in no
namespace, its interpretation depends on the element it is attached
to.  So you need not (and must not) prefix the href attribute.

-- Richard

Received on Tuesday, 22 April 2003 13:32:24 UTC