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

Re: Namespace: what's the correct usage?

  • From: Martin Gudgin <marting@d...>
  • To: "Simon St.Laurent" <simonstl@s...>
  • Date: Sat, 19 May 2001 23:38:56 +0100

correct usage

----- Original Message -----
From: "Simon St.Laurent" <simonstl@s...>
To: "Martin Gudgin" <marting@d...>
Cc: <xml-dev@l...>
Sent: Saturday, May 19, 2001 7:27 PM
Subject: Re: Namespace: what's the correct usage?


> On 19 May 2001 21:17:06 +0100, Martin Gudgin wrote:
> > > > package example.org.person;
> > > >
> > > > public class person
> > > > {
> > > >     String given;
> > > >     String family;
> > > > }
> > > >
> > > > to me at least...
> > >
> > > The difference is that in XML elements are first class entities, that
is
> > the
> > > "given" element is not declared within the scope of the "person"
class.
> >
> > But attributes are declared in the scope of their owner element. Why not
> > child elements? This is the crux of the question I think.
>
> You certainly can write processors which behave this way, but there's
> nothing _in the markup_ which indicates that the namespace scope for the
> child elements behaves that way.

[MJG]
What about the qualified parent element? It is in the markup and would serve
perfectly well as a namespace scope for its attributes. I'm just extending
that in my case to the child elements.

>
> If you start from public class person and think of it as a simple
> serialization problem, you may well end up with a very different answer
> than if you set out to solve the question of how best to mark this
> information up in an XML document.

[MJG]
Agreed. But local scoping is useful in programming languages and I
anticipate that it will be ( is? ) useful in XML documents even when not
dealing with class serialization.

>
> Unfortunately, I think the way you're going about using namespaces makes
> a lot of potentially unfounded assumptions about how the document will
> be processed.  In an environment you completely control, that's fine,
> but if your documents ever leak out to the rest of the world, you may
> well find that no one else shares your assumptions and that therefore
> the document is interpreted quite differently.

[MJG]
I think whichever way you use namespaces you are making assumptions about
the people who will see and process your XML. People use local scoping in
programming languages because it was recognised that putting everything in
global variables was a bad idea. I suspect that over time a similar
observation may apply to XML.

Cheers

Gudge


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Cast Your Vote

We need your help – Vote for DataDirect XML Products!

  • Best SOA or XML site

Winners and finalists announced at SOA World Conference in November.

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-2007 All Rights Reserved.