[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Another errata?
The example <html:a href="foo"> is identical to <html:a html:href="foo"> used in earlier mails to this list is less than ideal for the purpose of explaining namespaces on attributes. Let's back up. The A element in HTML is defined in http://www.w3.org/TR/REC-html40/ as <!ELEMENT A - - (%inline;)* -(A) -- anchor --> <!ATTLIST A %attrs; -- %coreattrs, %i18n, %events -- charset %Charset; #IMPLIED -- char encoding of linked resource -- type %ContentType; #IMPLIED -- advisory content type -- name CDATA #IMPLIED -- named link end -- href %URI; #IMPLIED -- URI for linked resource -- hreflang %LanguageCode; #IMPLIED -- language code -- rel %LinkTypes; #IMPLIED -- forward link types -- rev %LinkTypes; #IMPLIED -- reverse link types -- accesskey %Character; #IMPLIED -- accessibility key character -- shape %Shape; rect -- for use with client-side image maps -- coords %Coords; #IMPLIED -- for use with client-side image maps -- tabindex NUMBER #IMPLIED -- position in tabbing order -- onfocus %Script; #IMPLIED -- the element got the focus -- onblur %Script; #IMPLIED -- the element lost the focus -- > <!ENTITY % URI "CDATA" -- a Uniform Resource Identifier, see [URI] --> It happens that the href attribute in HTML is also defined for a few other element types, for example LINK and BASE, and for these elements it is also CDATA with essentially the same rules and meaning. This might lead one to think that the HREF attribute of an A tag is the same attribute type as the HREF attribute of the LINK tag. One might even go so far as to imagine that both HREF attributes are defined in some global scope, at the same level as elements, in other words, in the "HTML" namespace. The English text of the specification clearly implies that these attributes are to be seen as essentially the same. But the DTD does not say this. The English text and our experience using HTML gives us information not written in the DTD. DTDs today do not have any facility to express that two attributes with the same name, used within different element types, are the same in type or meaning. Within the expressive power of DTD, all we can observe is that the A tag has an attribute named HREF with certain properties. That is, there is an "href" attribute used within the "A" tag. There is also an "href" attribute used within the "LINK" tag. There is also an "href" attribute used within the "BASE" tag. And so forth. They happen to have the same properties. We know that they have the same meaning. But a DTD could equally well have defined an "href" attribute for a "TABLE" element that was a NUMBER and had no relation to the "href" of an "A" element. The DTD can only go so far as to say that an "href" used on an "A" element has certain properties, and that there is also an "href" on a "TABLE" element that has certain other properties. In other words, the definition of an attribute, within the expressive powers of DTD, is relative to its containing element. An unqualified attribute is identified by the triple consisting of the namespace of the element, the name of the element, and the name of the attribute. (See appendix A.3 of the namespaces spec.) This is a long build-up to the conclusion that an unqualified attribute cannot be presumed to come from the same namespace as its element, without qualification. Rather, the element provides a local namespace for its attributes. So is it true that <html:a href="foo"> is identical to <html:a html:href="foo"> ? There is nothing in a DTD that would allow us to decide that they are identical. They are no more the same than if the HTML DTD defined another element called "ANCHOR" and the English spec said that it has exactly the same meaning as the "A" element. We might, reading the English spec, know that they are the same. But qua DTD, they are different. The namespaces specification is designed to support the current practice of DTDs, and so defines unqualified attributes in this way, while leaving the door open to future forms of schema that express richer and more-global attribute scopes. xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i... Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ To (un)subscribe, mailto:majordomo@i... the following message; (un)subscribe xml-dev To subscribe to the digests, mailto:majordomo@i... the following message; subscribe xml-dev-digest List coordinator, Henry Rzepa (mailto:rzepa@i...)
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|