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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:19:45+00:00 2026-05-11T18:19:45+00:00

Hi I am trying to get my mind around XSDs, XML and namespaces but

  • 0

Hi I am trying to get my mind around XSDs, XML and namespaces but I can’t get things to work the way I want them to.

I have an XSD which, at the moment, starts like this:

<xs:schema attributeFormDefault="unqualified" elementFormDefault="unqualified" 
           xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns="http://www.example.com">
    <xs:import namespace="http://www.example.com" schemaLocation="Include.xsd" />

As you can see, it imports another xsd file, which starts like this:

<xs:schema attributeFormDefault="unqualified" elementFormDefault="unqualified" 
           targetNamespace="http://www.example.com" 
           xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns="http://www.example.com">

Then I have some xml documents based on this schema:

<foobar>
    <whatever>....

Basically I don’t care what the namespaces are, I just want the darn thing to work. Previously I wasn’t using any namespace but it seems that I have to use them in order to import one XSD into another. What I don’t want to do is have to supply prefixes to all the elements in my xml documents.

In order to achieve this, what combination of values do I need for the various attributes (targetNamespace, namespace, xmlns, elementFormDefault etc) in the XSD and XML documents?

Currently, any elements defined in the imported XSD document require namespace qualification in the XML.

  • 1 1 Answer
  • 1 View
  • 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-11T18:19:45+00:00Added an answer on May 11, 2026 at 6:19 pm

    If you aren’t using namespaces or your schemas share the same namespaces, you would be much better off using xs:include rather than xs:import. Schema A can include schema B if B either has the same namespace as A or has no namespace declared (if the latter is the case, B ‘adopts’ the includer’s namespace when included). So… something like:

    <xs:schema attributeFormDefault="unqualified" elementFormDefault="unqualified" 
               xmlns:xs="http://www.w3.org/2001/XMLSchema"
               xmlns="http://www.example.com">
        <xs:include schemaLocation="Include.xsd" />
    
    <!-- ... -->
    
    </xs:schema>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to get my mind around google protobuf. I found some implementation of protobuf
Trying to get this expression to work, can someone look at it and tell
i'm trying to solve a seemingly simple problem, but just can't quite get my
I have been trying to get this to work for about three solid days
I'm trying to get my mind around one aspect of memory management in the
Sorry if this is reposted, but I can't wrap my mind around it and
I am trying get all html links within a string and replace them using
I am trying get all html links within a string and replace them using
I am trying get Struts 2 and Tiles to work and I am using
I'm trying to get my head around using QuartzCore to render semi-complex text/gradient/image UITableViewCell

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.