On Friday, 08/22/2003 at 04:51 ZE2, Marcel <[EMAIL PROTECTED]> wrote:
> In general, should attributes have an namespace, or not ?
That's up to whoever designs the grammar for the XML language in question.
Most folks seem to put attributes into specific namespaces only when they
expect the attribute might be used on elements other than those of the
language which defines them. I'm not convinced that's the right answer
architecturally, since (as XPath demonstrates) it causes confusion for
proper namespace-based processing. But I can't really argue with the
convenience not having to provide prefixes.
Essentially, that kind of design is an attempt to cheat around the
"attributes aren't affected by the default namespace" rule, by making the
language interpretation derive semantics from context even when not bound
to a namespace. It isn't actually the default namespace/language they're
associating themselves with -- in most cases, it's the language of the
element they appear on.
Now that we've used namespaces for a while, I think there's evidence that
that rule might have made more sense than the "don't inherit any default"
rule. But the latter is what we've got, and now that namespaces have become
part of the basic semantics of XML we're sorta stuck with it for the
foreseeable future; there really isn't any way to rewrite the Namespaces
spec without doing a complete redesign of XML. And I don't think anyone's
ready to consider attempting XML 2.0 yet!