Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder mlse's Avatar
    Join Date
    Mar 2005
    Posts
    624
    Thanks
    20
    Thanked 19 Times in 18 Posts

    simple namespace question

    Consider an element <aaa> that contains <bbb>, in the following 3 examples:

    Code:
    <aaa xmlns="http:www.whatever.com">
      <bbb />
    </aaa>
    Code:
    <root xmlns:x="http:www.whatever.com">
      <x:aaa>
        <x:bbb />
      </x:aaa>
    </root>
    Code:
    <root xmlns:x="http:www.whatever.com">
      <x:aaa>
        <bbb />
      </x:aaa>
    </root>
    I know that in the first two examples, both <aaa> and <bbb> are part of the namespace x but is <bbb> part of x in the third example?
    Die Welt ist ein Irrenhaus und hier ist die Zentrale!

  • #2
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    not 100% sure, but I would think that <bbb/> would still be a child of the x node.

  • #3
    Moderator
    Join Date
    May 2002
    Location
    Hayward, CA
    Posts
    1,461
    Thanks
    1
    Thanked 23 Times in 21 Posts
    No. bbb in the third case lives in the default namespace, which is not specified in the root element.
    "The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
    June 30, 2001
    author, Verbosio prototype XML Editor
    author, JavaScript Developer's Dictionary
    https://alexvincent.us/blog

  • Users who have thanked Alex Vincent for this post:

    mlse (01-30-2009)

  • #4
    Regular Coder mlse's Avatar
    Join Date
    Mar 2005
    Posts
    624
    Thanks
    20
    Thanked 19 Times in 18 Posts
    Thanks Alex, I suspected that that was the case!
    Die Welt ist ein Irrenhaus und hier ist die Zentrale!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •