Whose attributes are they anyway?

Discussion in 'XML' started by Soren Kuula, Feb 27, 2005.

  1. Soren Kuula

    Soren Kuula Guest

    Hi,

    I just can't find namespaces of attributes states clearly enough in the
    XML namespace spec.
    But .. I hear rumors that attributes, unless qualified otherwise,
    default to the namespace of the owner element.
    Is that right ?

    Like:

    <?xml version='1.0'?>

    <!-- I would think that the "odor" attribute below should belong to the
    "smelly->http://www.stench.com"
    name space, as its owner element is in that? The irrelevant:eek:dor
    attribute, of course, is in
    the irrelevant->http://sweetaroma.org namespace ... right? -->

    <smelly:skunk
    xmlns:smelly="http://www.stench.com"
    xmlns:irrelevant="http://sweetaroma.org"
    xmlns="dongfang.dk"
    odor="a"
    irrelevant:eek:dor="b">

    <!-- And I would think that these two elements are semantically
    indistinguishable
    - - although one is 'lexically' a bit more explicit about the
    namespace of its
    non-"irrelevant"-NS odor attribute than the other .. right? -->

    <smelly:inner odor="1" irrelevant:eek:dor="2"/>
    <smelly:inner smelly:eek:dor="1" irrelevant:eek:dor="2"/>

    <!-- this would be two attributes w same name in same name space and w
    same owner element .. an error, right? -->
    <smelly:inner smelly:eek:dor="1" odor="2"/>
    </smelly:skunk>

    TNX for any reply

    Soren (who actually needs to decorate element with attributes in a
    different NS, without risk o' clashes)
    Soren Kuula, Feb 27, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Soren Kuula

    Whose attributes are they anyway?

    Soren Kuula, Feb 27, 2005, in forum: XML
    Replies:
    9
    Views:
    510
    David Carlisle
    Feb 28, 2005
  2. Asfand Yar Qazi
    Replies:
    4
    Views:
    384
    Asfand Yar Qazi
    Nov 12, 2004
  3. Martin M.
    Replies:
    4
    Views:
    335
    Simon Brunning
    Dec 15, 2005
  4. Dave Rudolf
    Replies:
    1
    Views:
    293
    Kai-Uwe Bux
    May 17, 2006
  5. David A. Black
    Replies:
    2
    Views:
    213
    Tim Hunter
    Aug 19, 2004
Loading...

Share This Page