- From: Steven Pemberton <Steven.Pemberton@cwi.nl>
- Date: Wed, 18 Sep 2002 16:17:00 +0200
- To: <xml-names-editor@w3.org>
- Cc: "HTML WG" <w3c-html-wg@w3.org>
I long misunderstood the Namespaces in XML specification. When I finally understood it, I discovered that many other people misunderstood it too. Since then I have had to explain it to many people, and therefore many of my comments below address ways of making the meaning clearer. However, before getting to textual changes, first some global points: 1. This should not proceed to CR before exit criteria have been agreed on, and those criteria should include conformance based on a test suite. 2. It is difficult to see how you can *possibly* proceed to CR until you include a definition of QNames as attribute values. These are now widely being used, above all by XML Schema, and not to define the meaning would be a major technical, political and public-relations error. Now the textual comments. Section 1. "[Definition: An XML namespace is a collection of names, identified by an IRI reference, which are used in XML documents as element types and attribute names. ]" This is a major source of confusion, because an XML namespace is *not* "a collection of names" by any definition of "collection" that I know. Appendix B hints at this, but unfortunately is non-normative, and nowhere else in the spec is the structure of a namespace defined. "Non-normative" means that it has no effect on the definition, and therefore can be left out with out affecting the definition. It was the basis of a lot of my original misunderstanding, since I paid little attention to Appendix B, since it was non-normative. Proposed new text: "Definition: An XML namespace is a triple [E, A, G], where E is a set of names representing the names of the elements in the namespace; A is a set of names representing all possible attributes of the elements; G is a set of names representing global attributes of the namespace." This formulation allows you to better explain the examples in 5.3, which drive a lot of people crazy, and explain better that global attributes are different from the other attributes that appear on elements (since this document introduced the concept of global attributes, as far as I am aware, many people misunderstood this point). You should also move appendix B.2 to this point. In any case, the last paragraph of that section is essential, and normative, and should appear here. -- "Therefore, the namespace prefix serves as a proxy for an IRI reference. " This is an incorrect use of the word 'proxy'. A proxy is an active agent. 'Alias' is the correct term here. -- Section 2. "It is not a goal that it be directly usable for retrieval of a schema (if any exists). " I have, in all fairness, to tell you that the phrase "It is not a goal" has become the source of much hilarity and many jokes in the several working groups I have been involved with, because of its lack of normative value. I would strongly encourage you to replace this sentence with something along the lines of: "It is neither required nor prohibited that this IRI reference be dereferencable for any purpose". -- "[Definition: If the attribute name matches PrefixedAttName, then the NCName gives the namespace prefix, " add 'part' after 'NCName'. -- "[Definition: If the attribute name matches DefaultAttName, then the namespace name in the attribute value is that of the default namespace in the scope of the element to which the declaration is attached.]" I'm pretty sure "for the scope of the element" is meant here. -- "The prefix xml is by definition bound to the namespace name http://www.w3.org/XML/1998/ namespace. " Please use <code></code> (or similar) around 'xml', and the namespace IRI. -- "The prefix xmlns is used only to declare namespace bindings and is by definition bound to the namespace name http://www.w3.org/2000/xmlns/. " Likewise. -- 3. Qualified names "The Prefix provides the namespace prefix part of the qualified name, and must be associated with a namespace IRI reference in a namespace declaration." I'm not sure what 'must be associated with' means here. I would say: "and must match a namespace IRI reference in a namespace declaration". -- "Note that the prefix functions only as a placeholder for a namespace name. Applications should use the namespace name, not the prefix, in constructing names whose scope extends beyond the containing document." Now it has gone from being a proxy to a placeholder! Replace 'placeholder' with 'alias'. But there is something terribly wrong with this paragraph: first it starts with 'Note', which suggests it is non-normative, and then it uses the word 'should', which I am pretty sure ought to be a 'must'. So replace this with: "The prefix functions only as an alias for a namespace name. Applications must use the corresponding namespace name, not the prefix, in constructing names whose scope extends beyond the containing document." and I wonder about "in constructing names whose scope extends beyond the containing document." Isn't it about 'indentifying' names, rather than 'constructing' names? -- 4 Using Qualified Names "An example of a qualified name serving as an element type: <x xmlns:edi='http://ecommerce.org/schema'> <!-- the 'price' element's namespace is http://ecommerce.org/schema --> <edi:price units='Euro'>32.18</edi:price> </x>" Since 'x' is also a qualified name according to production [6], this might be misleading to the reader. Just use <edi:price xmlns:edi='http://ecommerce.org/schema' units='Euro'>32.18</edi:price> -- "[12] Attribute ::= NSAttName Eq AttValue | QName Eq AttValue [NSC: Prefix Declared]" This production is ambiguous for an attribute "xmlns=..." and "xmlns:foo=...". Maybe you don't care, but since [prefix declared] already excludes xmlns and xmlns:, I don't see the need for the two parts. Replace with: [12] Attribute ::= QName Eq AttValue [NSC: Prefix Declared] -- "For correct operation with such applications, namespace declarations must be provided either directly or via default attributes declared in the internal subset of the DTD." What does the 'must' refer to here? 1) If you also want your documents to work with non-validating, you must provide NS declarations 2) You must always provide NS declarations (so that documents work in all evironments). You should make it clear. -- 5.1 Namespace Scoping The correct namespace IRI for HTML is: <html:html xmlns:html='http://www.w3.org/1999/xhtml'> -- 5.2 Namespace Defaulting "A default namespace declaration is considered to apply to the element where it is specified, and to all elements within the content of that element, unless overridden by another default namespace declaration." What does 'considered' mean here? Replace "is considered to apply" with "applies". -- "If the IRI reference in a default namespace declaration is empty, then unprefixed elements in the scope of the declaration are not considered to be in any namespace." Again the 'considered' problem. Delete "considered to be ". -- "Note that default namespaces do not apply directly to attributes." This sentence causes more confusion and arguments than any other single sentence in the spec (partly because of factors I have already mentioned). It amazes me how many different interpretations I have heard. Of course, the key is in the word 'directly', because attributes get their namespace association indirectly from the element that they are attached to, but try telling that to some of the people I have talked to... What I *think* is intended here is to point out that though you can default a namespace, so that instead of <html:p ...> you can write <p ...> you can't default <... html:class=... to <... class=... since class= has a different meaning here. Say that. -- "<html xmlns='http://www.w3.org/TR/REC-html40'>" Please use the correct IRI, 'http://www.w3.org/1999/xhtml' -- " <p xmlns='urn:w3-org-ns:HTML'>" Wow! Please use the correct IRI, 'http://www.w3.org/1999/xhtml' -- "<?xml version='1.1'?> <Beers> <!-- the default namespace is now that of HTML --> <table xmlns='http://www.w3.org/TR/REC-html40'>" The comment should either come *after* the line that declares the namespace, or read differently (and the correct IRI should be used). Either: <?xml version='1.1'?> <Beers> <table xmlns='http://www.w3.org/1999/xhtml'> <!-- the default namespace is now that of HTML --> or <?xml version='1.1'?> <Beers> <!-- the default namespace is that of HTML: --> <table xmlns='http://www.w3.org/1999/xhtml'> -- "<!-- http://www.w3.org is bound to n1 and is the default --> <x xmlns:n1="http://www.w3.org" xmlns="http://www.w3.org" > <good a="1" b="2" /> <good a="1" n1:a="2" /> </x>" Many many people give up here in incomprehension. Explain that 'a' comes from A, and 'n1:a' from G (as defined above), and you get smiling faces. -- Appendix B.1 Delete this appendix. It only muddies the waters. If you can't bring yourselves to do that, please make the following changes. "<RESERVATION> <NAME HTML:CLASS="largeSansSerif">Layman, A</NAME> <SEAT CLASS="Y" HTML:CLASS="reallyImportant">33B</SEAT> <DEPARTURE>1997-05-24T07:55:00+1</DEPARTURE></RESERVATION>" Replace 'HTML:CLASS' with 'HTML:class' or 'html:class' throughout. Encoding presentation artifacts in 'class' is bad practice. Please replace 'largeSansSerif' with something more acceptable, such as 'identification'. -- "which is used to simulate syntactic richness in HTML, as a means of overcoming the limited element repertoire by subclassing." That's certainly one point of view. Please replace with something like "which is used for element subclassing". -- "XML does not provide a built-in way to declare "global" attributes; items such as the HTML CLASS attribute are global only in their prose description and their interpretation by HTML applications. However, such attributes, an important distinguishing feature of which is that their names are unique, are commonly observed to occur in a variety of applications." Well, there is a way to describe them now. HTML:class has not yet ever been formally described as a global attribute in the HTML namespace, so this paragraph is misleading. Delete. -- Appendix B.2. As already suggested, this should be moved in to the normative part of the spec. -- Appendix B.3. I never understood the point of this appendix, nor what it adds. Delete. If not, the changes to B1 apply here too. -- Best wishes, Steven Pemberton for the HTML Wroking Group
Received on Wednesday, 18 September 2002 10:17:06 UTC