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

Re: Namespace: what's the correct usage?

  • From: Kohsuke KAWAGUCHI <kohsukekawaguchi@y...>
  • To: Martin Gudgin <marting@d...>
  • Date: Sun, 20 May 2001 13:38:12 -0700

usage of it

I'm glad to know that we are not the only ones who have opinions about
this.


> Bottom line. Why should everyone have to use namespaces in a particular way?
> I just don't get it...

I'm just trying to say that everyone should avoid using unqualified
local elements. It doesn't mean we have to use it in only one way.



> Actually, I provided that example because I thought you may be happier with
> it. In reality I use the class name for the top-level element. Why? Because
> typically I'm serializing an instance of a class and I probably don't know

OK, then take a look at another example of yours. I think you agree to
unqualify title, genre, and familyName.

<p:book xmlns:p='urn:x1'>
  <title>The Hobbit</title>
  <genre>Fantasy</genre>
  <p:author>
    <title>Dr</title>
    <familyName>Tolkien</familyName>
  </p:author>
</p:book>

But I guess you would object to unqualify <author> element. But why?
"author" is a field of an instance of the book type, just like title and
genre do.


If you don't object to unqualify <author> element. Then the root element
is the only element in your instance that is qualified. Then what is
the reason to qualify <book>? Why not unqualify all?

Technically, your statement that the "unqualified-local" doctrine is
suitable for "data serialized as XML" is wrong.



> No, this was not invented by XML Schema, unqualified elements are allowed by
> the namespaces rec just as unqualified attributes are allowed by the
> namespaces rec.

Of course it is "allowed".  But it's just that nobody imagined that such
an interpretation is possible.


> Again, I reiterate, it's not that the qualify-all approach is wrong, it's
> that I don't see it as the only approach.

I know. I can't state without some hesitation that it is THE only one
approach. But I believe the unqualified-local doctrine is wrong.


> And it's used by SOAP which is a fairly popular technology, in fact I'd say

That's why I really want to know if there is any other spec that uses
the same doctrine.  So far, nothing is mentioned by anyone.

I checked XML-RPC but it doesn't use XML namespaces at all.


> > If so, the innocent authors should be warned not to be trapped to such a
> > small dialect just because he/she wants to use XML Schema. And in fact
> > there are many practical reasons (vulnerability to the change of the
> > schema structure, more typing, etc.) that he/she should avoid it.
> 
> [MJG]
> What authors? There are no (few?) authors for SOAP messages, unless you

I meant "the innocent schema authors" who are just beginning to learn
XML Schema.


> And why is this a 'small dialect'?

Because virtually every known schema (except SOAP) uses the "qualify-all"
doctrine.


> Why does using unqualified local elements lead to 'vulnerability to the
> change in schema structure' and 'more typing'?

"It is vulnerable to the change in a schema file" because instance
documents have to be changed if you change one of your local declaration
to a global one so that it can be shared.

"It needs more typing" because you can't use the default namespace
declaration.

I think these are objective facts.


> > An explanation along with this line may be more adequate.
> Err, I didn't understand this last sentence?

Sorry. I meant that an explanation along with this line is probably more
adequate for my "XML Schema: DOs and DON'Ts", as the reason of why one
should avoid unqualified local elements.


regards,
----------------------
K.Kawaguchi
E-Mail: kohsukekawaguchi@y...


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.