[
Lists Home |
Date Index |
Thread Index
]
8/20/2002 10:58:50 AM, amyzing@talsever.com (Amelia A Lewis) wrote:
>Not according to the infoset, although it depends upon how you define
>things. The official terminology, as John Cowan reminded me, is "namespace
>attribute." This happens to be one of those things that is utterly
>impossible to explain to someone whose program is broken and thus needs to
>understand the distinction between namespace decls and attributes. A
>namespace is an attribute that isn't treated as an attribute and isn't
>accessible as an attribute unless you're using DOM .... Bleah. A namespace
>declaration is not an attribute (that is, it is not accessible via the
>"attributes" property of element information items in the infoset).
Here's how I understand it:
- namespace declarations aren't mentioned in XML 1.0 and DOM Level 1
- The namespaces spec fudges a bit ... "An attribute-based syntax
described below is used to declare the association of the namespace prefix
with a URI reference". Is an "attribute-based syntax" an "attribute?"
Sorry, I flunked Exegesis 101 in divinity school :~)
- DOM Level 2 basically treats namespace declarations as attributes.
It does not provide a convenient way to find the in-scope namespaces
associated with an element.
- The InfoSet spec does specify that the list of in-scope namespaces
are associated with each element.
- The InfoSet spec distinguished "namespace attributes" from
"attributes". Namespace declarations of all sorts are namespace
attributes, but don't appear in an element's list of attributes.
- XPath data model specifies that an element has a namespace property
giving its in-scope namespace; namespace declarations do not appear
as attributes.
Assertions as to whether namespace declarations are attributes have to be
qualified by the particular spec, there is no "right" answer for the
XML corpus as a whole. If I believed in an orderly universe, I would
expect this to be sorted out in XML + namespaces + infoset 2.0, but
I'm not holding my breath.
|