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

Re: Namespace: what's the correct usage?

  • From: Jeff Rafter <jeffrafter@e...>
  • To: xml-dev@l...
  • Date: Mon, 21 May 2001 15:27:36 -0700

correct usage of concede
Well, go to one large computer gaming conference and look what happens... I
apologize for being wildly out of the loop but I have read the thread and
think I have some important viewpoints to add.  I will try to be brief-- ask
for clarification if needed.

1) I think Martin's example is perfectly legal wrt to XML Schemas and XML
Namespaces.  Moreover, I think (coming from an implementation of XML Schemas
POV) it actually makes a ton of sense.  I think a lot of the initial
confusion in the beginning of the thread was centered around the three terms
"unprefixed", "unqualified" and "no-namespace".  These are different, and as
Martin has asserted, unqualified namespaces are determined by context and
declaration-- I take the prefix as syntactic sugar.

2) That being said-- the first time I stumbled onto a sample such as
Martin's-- I thought, "Whoa-- that is an error..." only an hour later did I
learn it was valid.  Only a month or two later did I understand why it was
good.  Qualified names are much more easy to understand and program for
(from experience) whereas unqualified names *are* dependent on context and
declaration.  Being dependent on declaration means that each instance *must*
be processed by a schema validator to obtain PSVI wrt namespace uris (unless
the exception of xmlns='' is presumed a priori).  For example:

<root xmlns="http://foo">
  <name>
     <mandatory-title-element/>
  </name>
  <p:person xmlns:p='urn:x2' >
    <name>Martin</name>
    <age>33</age>
  </p:person>
</root>

Without the use of xmlns='' this get's ugly in a hurry.  There is definitely
an ambiguity introduced for <name>.  From the instance one can imagine that
<name> is declared in both the http://foo and urn:x2 namespaces.  So which
namespace is the "Martin" element actually in?  It get's confusing-- it is
either part of the default namespace (though this is very hard to declare in
actuality) or it is an unqualified element from the urn:x2 namespace (which
is the more correct assumption).

3) I think for the reasons stated above qualified is the "easiest" practice
(and therefore best?).  While I concede Martin's point about package details
and Java representation-- it seems simple enough to relent and utilize a
default namespace in that case (which I have done with some success)

  <person xmlns='urn:x2' >
    <name>Martin</name>
    <age>33</age>
  </person>

Regards,
Jeff Rafter
Defined Systems
http://www.defined.net
XML Development and Developer Web Hosting


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.