Namespaces

Discussion in 'XML' started by R.Georges, Sep 25, 2003.

  1. R.Georges

    R.Georges Guest

    Hello,

    I'm a little confused with namespaces and non qualified name :

    If I write

    <a xmlns:p="http://www.blabla.com">
    <b/>
    </a>

    I should consider 'a' inside the 'http://www.blabla.com' namespace. Do I consider
    too 'b' as a part of this namespace as their no default namespace ?

    If yes what the interest of the xmlns attribute ?

    Other point :

    <a xmlns:p="http://www.blabla.com" xmlns="http://www.blibli.com">
    <b/>
    </a>

    Do I consider 'a' and 'b' on the "http://www.blibli.com" namespace ?

    If yes, what happened when writing :

    <p:a xmlns:p="http://www.blabla.com" xmlns="http://www.blibli.com">
    <b/>
    </p:a>

    Do I consider 'b' on the http://www.blibli.com namespace or http://www.blabla.com ?

    Thanks in advances,

    G.
     
    R.Georges, Sep 25, 2003
    #1
    1. Advertising

  2. In article <>,
    R.Georges <> wrote:


    ><a xmlns:p="http://www.blabla.com">
    > <b/>
    ></a>


    >I should consider 'a' inside the 'http://www.blabla.com'
    >namespace. Do I consider too 'b' as a part of this namespace as their
    >no default namespace ?


    No, b is in no namespace.

    (Some people - a few - write documents in which elements in no
    namespace are interpreted according to the namespace of the enclosing
    namespaced element, in the same way that most people make the
    interpretation of no-namespace attributes depend on the element
    they're attached to. But that's a matter of interpretation; as
    far as the XML namespaces spec is concerned, such elements are not
    in any namespace. XML schema's elementForm="unqualified" exists for
    the benefit of these people.)

    ><a xmlns:p="http://www.blabla.com" xmlns="http://www.blibli.com">
    > <b/>
    ></a>
    >
    >Do I consider 'a' and 'b' on the "http://www.blibli.com" namespace ?


    Yes.

    >If yes, what happened when writing :
    >
    ><p:a xmlns:p="http://www.blabla.com" xmlns="http://www.blibli.com">
    > <b/>
    ></p:a>
    >
    >Do I consider 'b' on the http://www.blibli.com namespace or
    >http://www.blabla.com ?


    a is in the blabla namespace and b is in the blibli namespace.

    -- Richard
    --
    Spam filter: to mail me from a .com/.net site, put my surname in the headers.

    FreeBSD rules!
     
    Richard Tobin, Sep 25, 2003
    #2
    1. Advertising

  3. R.Georges wrote:
    > <a xmlns:p="http://www.blabla.com">
    > <b/>
    > </a>
    >
    > I should consider 'a' inside the 'http://www.blabla.com' namespace.


    No, it's in no namespace. It must be 'p:a' to be in the
    'http://www.blabla.com' namespace.
    --
    Johannes Koch
    In te domine speravi; non confundar in aeternum.
    (Te Deum, 4th cent.)
     
    Johannes Koch, Sep 25, 2003
    #3
  4. R.Georges

    Dean Tiegs Guest

    (Richard Tobin) writes:

    > In article <>,
    > R.Georges <> wrote:
    >
    >
    >><a xmlns:p="http://www.blabla.com">
    >> <b/>
    >></a>

    >
    >>I should consider 'a' inside the 'http://www.blabla.com'
    >>namespace. Do I consider too 'b' as a part of this namespace as
    >>their no default namespace ?

    >
    > No, b is in no namespace.


    Note that in this example element "a" is also in no namespace. The
    namespace declaration is only for elements prefixed with "p".

    --
    Dean Tiegs, NE¼-20-52-25-W4
    “Confortare et esto robustusâ€
    http://telusplanet.net/public/dctiegs/
     
    Dean Tiegs, Sep 25, 2003
    #4
    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. valentin tihomirov

    namespaces

    valentin tihomirov, May 24, 2004, in forum: VHDL
    Replies:
    0
    Views:
    599
    valentin tihomirov
    May 24, 2004
  2. Craig Deelsnyder

    Best Practices - solution - namespaces - classes

    Craig Deelsnyder, Aug 3, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    431
    Vincent V
    Aug 4, 2003
  3. Will

    Conflicting namespaces??

    Will, Aug 13, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    1,693
    Chris R. Timmons
    Aug 13, 2003
  4. ravi sankar
    Replies:
    2
    Views:
    387
    abdul bari
    Aug 27, 2003
  5. D. Shane Fowlkes
    Replies:
    1
    Views:
    939
    Tu-Thach
    Jan 13, 2004
Loading...

Share This Page