Namespaces - defaulting question (re:WD-xml-names19980916)

Steve Harris sharris at primus.com
Thu Nov 5 22:34:37 GMT 1998


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 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