wd-xml-names: resolve the element name in the scope of its containing element.

John Cowan cowan at locke.ccil.org
Tue Aug 11 23:00:35 BST 1998


Tim Bray wrote:

> >until an element name is resolved, it is not possible to determine which (or
> >even whether a) element declaration applies unless the prefixes are awarded
> >global status. which method namespaces are intended to avoid.
> 
> What do you mean by "resolve"?  What do you mean by "a) element declaration
> applies"?  The attribute-based declarations apply to the element on which
> they're attached and to others within that scope unless overridden.  If
> the draft doesn't make that clear it's a bug.  Please suggest wording
> which would make it more clear.

Here's my take on it.  Suppose you have the fragment:

	<foo:a>This is <b>mixed</b>content</foo:a>

where "foo" is not a previously declared prefix.  One must then consult
the DTD to see whether the element declaration for "foo:a" contains
a default (or fixed) value for the "xmlns:foo" attribute.  If not,
a namespace constraint has been violated.

Without prefix mapping in
the DTD, there is a possibility that the wrong "foo:a" will be fetched.
Or more accurately, there can be only one set of "foo:a" ATTLIST declarations,
and they had better be correct.  This is the only way to determine
the URI corresponding to both the "a" and "b" elements.

In short:  DTDs don't just serve validation, they serve attribute
normalization as well, and only after attributes are normalized
can the full set of namespace declarations be determined.

> >the containing element (or the document entity) could (assuming the encoding
> >is supported) just as well provide the binding. this would avoid the ambiguity.
> 
> What do you mean by "encoding"? What do you mean, in this context, by
> "binding"?  What ambiguity are you talking about?

Paraphrase:  "The declaration of a namespace could be placed in the
parent element, such that the prefix-to-URI mapping affects only
its children, and not itself."

> >what is the argument for having an element qualify its own identifier?
> 
> What do you mean by "qualify"?  What do you mean by "identifier"?

Paraphrase: "What (rhetorical) argument is used to
defend the position that the attributes of an element should provide
the URI for its own GI?"

=====

Note on my own account:  The draft implies that non-validating parsers
may differ from each other, and from validating parsers, on which
namespaces the elements and attributes in an instance may belong to, and
whether they belong to any at all, depending on whether the parser reads
the DTD in full, partially, or not at all.  Non-validating parsers
cannot assume that because they do not know the definition of a
prefix, that it is an error to use it.

<strong>All these considerations fall to the ground if namespace attributes
*cannot* be defaulted from the DTD (unlike other XML attributes).
The draft is silent on the point.</strong>

-- 
John Cowan	http://www.ccil.org/~cowan		cowan at ccil.org
	You tollerday donsk?  N.  You tolkatiff scowegian?  Nn.
	You spigotty anglease?  Nnn.  You phonio saxo?  Nnnn.
		Clear all so!  'Tis a Jute.... (Finnegans Wake 16.5)

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)




More information about the Xml-dev mailing list