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

Re: Global/Local attributes


Re:  Global/Local attributes
>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.

> 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.

Just to be absolutely clear, given:

 <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*.

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.

-- Richard

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.