OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] Global/Local attributes

[ Lists Home | Date Index | Thread Index ]

>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




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS