Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 597387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:16:29+00:00 2026-05-13T16:16:29+00:00

Something confuses me here: The NSXMLParser method has a namespaceURI attribute: – (void)parser:(NSXMLParser *)parser

  • 0

Something confuses me here:

The NSXMLParser method has a namespaceURI attribute:

- (void)parser:(NSXMLParser *)parser 
 didEndElement:(NSString *)elementName 
  namespaceURI:(NSString *)namespaceURI 
 qualifiedName:(NSString *)qName

From the documentation I couldn’t figure out what they mean by “namespace”. Can someone explain with an example what a namespace is in a XML and why I would want that?

Edit: Yep, I noticed wikipedia. But it’s confusing, again. What sense does it make to put one single namespace declaration at the top of the XML file like

xmlns:xhtml="http://www.w3.org/1999/xhtml"

?? Again, that makes just zero sense. Wikipedia has no useful example either to get it, why I would really want namespaces and -more importantly- how this looks in an XML file. They say it’s for resolving ambiguity of multiple same-named elements like ID, but there’s no example how multiple namespaces would resolve that.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T16:16:30+00:00Added an answer on May 13, 2026 at 4:16 pm

    XML namespaces work like namespaces everywhere else.

    They provide a means to uniquely distinguish equally named elements or attributes. This is done by declaring a namespace URI, and optionally attaching a prefix to the node name. This prefix is (optionally) defined along with the namespace declaration.

    <!-- node without any namespace (it's in the default namespace) -->
    <node>
      <child /><!-- descendants are in the parent namespace by default -->
    </node>
    
    <!-- node with explicit default namespace -->
    <node xmlns="http://some/namespace/uri/">
      <child /><!-- descendants are in the parent namespace by default -->
    </node>
    
    <!-- NS declaration with prefix (node is still in the default namespace!) -->
    <node xmlns:prefix="http://some/namespace/uri/">
      <child /><!-- descendants are in the parent's namespace -->
      <prefix:child><!-- explicit namespace assignment by prefix -->
        <grandchild /><!-- prefixes don't propagate, this is in the default namespace! -->
      </prefix:child>
    </node>
    

    Namespaces are strictly scoped. They are available to the node and its descendants only. To have a namespace available in the entire XML document, it must be declared at the top level element (document element).

    In your case, on the example or <prefix:child />:

    didEndElement = "child"
     namespaceURI = "http://some/namespace/uri/"
    qualifiedName = "prefix:child"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 315k
  • Answers 315k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer A sharepoint workflow runs on the thread starting it until… May 13, 2026 at 11:18 pm
  • Editorial Team
    Editorial Team added an answer It's one line of code: var myArray:Array = Array(myXML..@url); trace(myArray);… May 13, 2026 at 11:18 pm
  • Editorial Team
    Editorial Team added an answer I actually figured this out on my own. Just create… May 13, 2026 at 11:18 pm

Related Questions

I got an assessment to write a simple chat client for Linux using ncurses.
I need to add GPS functionality to an existing Blackberry Application that I've written.
I need a rewrite rule that will do an internal redirect from: <domain>/directory/<anything>/<anything>.php to:
So, I'm looking through a java library (JScience) after someone here thoughfully pointed me
Switching to GCC for the first time, and I'm getting a bit confused by

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.