[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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

  • From: Steve Harris <sharris@p...>
  • To: "'xml-dev@i...'" <xml-dev@i...>
  • Date: Thu, 5 Nov 1998 14:32:30 -0800

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!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.