Namespaces - defaulting question (re:WD-xml-names19980916)
Reading the Namespaces specification, I've found contradictory examples of namespace defaulting. Any input in determining the proper interpretation would be greatly appreciated. The first example is as follows: <?xml version="1.0"?> <x xmlns:edi='http://ecommerce.org/schema'> <!-- the edi namespace applies to the "x" element and contents --> </x> Here, the inline comment suggests that the element 'x' now lies within the 'edi' namespace. Later in the specification, we find this example (slightly reformatted for clarity): <RESERVATION xmlns:HTML="http://www.w3.org/TR/REC-html40"> <NAME HTML:CLASS="largeSansSerif">Layman, A</NAME> <SEAT CLASS="Y" HTML:CLASS="largeMonotype">33B</SEAT> <HTML:A HREF='/cgi-bin/ResStatus'>Check Status</HTML:A> <DEPARTURE>1997-05-24T07:55:00+1</DEPARTURE> </RESERVATION> The specification authors break this instance apart into the 'Expanded Element Types and Attribute Names' meta-markup to illustrate proper interpretation. There, the element 'RESERVATION' is not associated with the namespace prefix 'HTML'. This contradicts the first example's binding. Section 5.2 reads, "A _default namespace_ is considered to apply to the element where it is declared (if that element has no namespace prefix), and to all elements with no prefix within the content of that element." Elsewhere, Section 2 defines the term 'default namespace' as: [Definition]: If the colon and NCName are not provided, then the associated _namespace name_ is that of a *default namespace* in the scope of the element to which the declaration is attached. By these two definitions, it sounds like the first example above is incorrect. The 'edi' prefix should not bind to element 'x' since the declaration is not a default namespace declaration. Please confirm or deny this assertion. I apologize if this topic has been covered before. Scouring the archives didn't turn up anything that directly answers the question. Steven E. Harris Software Engineer PRIMUS 1601 Fifth Avenue, Suite 1900 Seattle, Washington 98101 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