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 7690055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:18:34+00:00 2026-05-31T20:18:34+00:00

I have been working with XML for a while now, but some things I

  • 0

I have been working with XML for a while now, but some things I have just used without really understanding why they work the way they do. Now I would like to change that.

This question is about namespaces.

This is what I think I have understood so far:

  1. The namespace can be any string. It is meant to be a unique identifier world wide.
  2. In order to qualify an XML element with a namespace, you cannot simply prefix the namespace in front of the element name, you need to use a separate prefix which needs to be declared at the beginning of the scope you want to apply the namespace to.
  3. You are free to choose the prefix.
  4. You are not free to choose the namespace (?)
  5. Although a namespace doesn’t necessarily reference anything as a URL, it can very well reference a targetNamespace.

Now, my question, does every namespace reference a targetNamespace ? When I declare xsi to be the prefix for XML Schema, does XML Schema declare that same namespace as its targetNamespace somewhere ? (where?). When I declare xsl to be the prefix for the XSLT namespace, does that mean that the XSLT namespace is declared somewhere as targetNamespace (where?)?

If we can have namespaces without any reference to a targetNamespace, in what situations would we use them? Why would we need them ?

  • 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-31T20:18:36+00:00Added an answer on May 31, 2026 at 8:18 pm

    You were doing OK until

    1. You are not free to choose the namespace (?)

    Whether or not you are free to choose the namespace depends on what you want to do. If you are making up a new vocabulary you get to choose the namespace (or no namespace). if you want to use an existing vocabulary such as XHTML or MathML or DocBook or … then if course, you have to use the namespace specified.

    1. Although a namespace doesn’t necessarily reference anything as a URL, it can very well reference a targetNamespace.

    Terminology problem here I think so I’m not sure what you mean. the namespace spec itself does not have any concept of “targetNamespace”. The term is used of a w3c XML schema to say which namespace the elements described in the schema come from the “target namespace” of the schema. So it isn’t a term you can really apply to a single instance of a namespace in an XML document.

    so….

    Now, my question, does every namespace reference a targetNamespace ?

    As noted above I’m not sure this question has meaning, but the answer is essentially “no”.

    When I declare xsi to be the prefix for XML Schema, does XML Schema
    declare that same namespace as its targetNamespace somewhere ?

    there is a schema for schema that declares the attributes used traditionally for the xsi prefix, and in that sense it will have this namespace as its target namespace, yes.

    If we can have namespaces without any reference to a targetNamespace,
    in what situations would we use them? Why would we need them ?

    Any namespace defined without reference to XSD schema doesn’t have anything that could be called a targetNamespace. However if you have an XSD based workflow you can always create such a schema, either from scratch or by converting a DTd or RelaxNg schema. So whether or not there is an XSD schema for a namespace is not an inherent property of the namespace. So for example the XHTML namespace http://www.w3.org/1999/xhtml for a long time (and again, in its html5 incarnation) does not have any official XSD schema associated that has that URI as its target namespace.

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

Sidebar

Related Questions

I have been working with Struts for some time, but for a project I
I have been using this code to parse xml till now. Its was working
I have been working with python for a while now. Recently I got into
I'm new to AS3 and have been working on an XML driven navigation system
I have been working on some legacy C++ code that uses variable length structures
I have been working with relational databases for sometime, but it only recently occurred
I have been working as a native C++ programmer for last few years. Now
I have been working on a project for a few months now and my
I've got a question that has been bugging me for a while now, but
This is something I've been stuck on for a while now, and I have

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.