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

Re: Global/Local attributes


Re:  Global/Local attributes
----- Original Message -----
From: "Richard Tobin" <richard@c...>
>
> >But it isn't just syntactic minimization.  Named namespaces and default
> >namespaces are not they same.
>
> The default namespace isn't *unnamed*.  The name of a namespace is
> its namespace URI.  A default namespace is just one that you're using
> without a prefix in this document.

Sorry... namespaces identified by a prefix and default namespace (which does
not have a prefix) are not the same.

> > They have different semantics.
>
> Using the default namespace mechanism to refer to a namespace does not
> change the semantics of that namespace.  The only difference is that
> there's one thing you can't do with no-prefix that you can do with a
> prefix, viz put an attribute in the namespace.

Two things.  You also cannot use elements that do not belong to a namespace
as long as a default namespace is defined.

>  <bar xmlns="http://example.org" xmlns:foo="http://example.org"
foo:att="1">
>
> The element bar and the attribute foo:att are in the same namespace,
> which happens to be the default namespace.  There aren't two
> namespaces that could have different semantics, there's only one.
> There are two different *syntaxes*.

That's not what I meant.  I am saying that

    <bar xmlns="http://example.org" att="1">

and

    <bar xmlns:foo="http://example.org" foo:att="1">

are not the same.  Both lines employ the use of namespaces, but they result
in the overall XML having different semantics.

> If you're taking an old document - or set of documents - and giving it
> a namespace, you can usually choose not to require the attributes to
> be in a namespace, so using no prefix will be fine.
>
> To re-iterate what's been said several times before: whether
>
>   <foo:bar att="123">
> and
>   <foo:bar foo:att="123">
>
> are equivalent (and whether either is illegal) is a matter for the
> application.  It's something you as an author have to *choose* when
> converting a non-namespaced vocabulary to use namespaces.  If you
> choose to allow or require namespaced attributes, you won't be able
> to use the default namespace exclusively.

Which gets back into what Simon was saying (I think)...

Okay, I am backing down from this thread.  I obviously view namespaces
differently that you and David (and probably many others).  Something tells
me we could go on until we are each blue in the face and still be no more in
agreement than we are now.  :)

---
Seairth Jacobs
seairth@s...


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.