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

  • SEARCH
  • Home
  • 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 144021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T08:11:15+00:00 2026-05-11T08:11:15+00:00

In programming languages, I’m used to namespace foo { namespace bar { void DoIt()

  • 0

In programming languages, I’m used to

namespace foo {     namespace bar     {         void DoIt()         {         }     } }  int main() {     foo::bar::DoIt() } 

In a schema(xsd), I’d like to do similar things when defining complexTypes

<xsd:schema targetNamespace='http://www.stackoverflow.com/foo'>  <xsd:complexType name='bar1'>     ...  </xsd:complexType>  <xsd:complexType name='bar2'>  </xsd:complexType>    ...  <xsd:complexType name='foo1' type = 'bar1'>    ...  </xsd:complexType> </xsd:schema> 

Conceptually I would like bar1 and bar2 to be nested in a http://www.stackoverflow.com/foo::bar namespace (:: borrowed from C++). I’ve seen examples of what seems to be a completely second namespace defined for the bar stuff. In these examples, the bar stuff will be defined in a second namespace, ‘http://www.stackoverflow.com/foo/bar‘, as in the example below. This is the closest I’ve seen to a ‘nested’ namespace.

So one thing I can kind of do is import the bar stuff from a different schema

<xsd:schema targetNamespace='http://www.stackoverflow.com/foo'   xmlns:bar = 'http://www.stackoverflow.com/foo/bar'> <xsd:schema namespace='http://www.stackoverflow.com/foo/bar'  <xsd:complexType name='foo1'>    <xsd:element name='bar1Instance' type='bar:bar1'/>    ...  </xsd:complexType> </xsd:schema> 

Part of this is that I’m just trying to grok how namespaces are different in XML vs say C++. Is there a concept of nested namespaces in XML or is each namespace independent? How is the concept of nested namespaces implemented or typically done? Is it done like my example above? Are namespaces completely independent or is there anyway of creating a nesting relationship?

  • 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. 2026-05-11T08:11:15+00:00Added an answer on May 11, 2026 at 8:11 am

    In XML, each namespace is entirely independent. The actual string of a namespace is not parsed in any meaningful way. It just is. XML Namespace strings are typically URLs because this makes a good chance that people won’t accidentally pick the same namespace for unrelated schemas.

    If you Google, you will find examples of ‘nested XML namespaces.’ These examples aren’t talking about what you’re asking about, not in the sense of C++ (or Java or C#…) namespaces. These examples show XML documents with multiple namespaces in use.

    An XML namespace string is simply an opaque and unique string that represents the schema. If two namespace strings happen to be very similar, it doesn’t mean anything.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

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

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

    • 7 Answers
  • Editorial Team

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

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The main thing you're losing is easy navigation through the… May 11, 2026 at 11:48 pm
  • Editorial Team
    Editorial Team added an answer Take a look at the CodeIgniter manual on Sessions and… May 11, 2026 at 11:48 pm
  • Editorial Team
    Editorial Team added an answer You can obfuscate it, but there's no way of protecting… May 11, 2026 at 11:48 pm

Related Questions

In programming languages, I'm used to namespace foo { namespace bar { void DoIt()
For me , the Pointer was one of the hardest concept in programming languages
Generally speaking, we all hear about the functions or procedures in programming languages. However,
This is my very first question so I am a bit nervous about it
We're migrating home folders to a new filesystem, and I am looking for a

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.