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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:59:08+00:00 2026-05-26T23:59:08+00:00

We are writing a new xsd schema that will be based upon and reference

  • 0

We are writing a new xsd schema that will be based upon and reference another schema (that is an industry de facto standard for GPS data called GPX). Our schema will be used in validating documents generated by our clients, and in testing. I need to better understand how to reference the base schema from our new schema, especially given that our systems cannot be expected to have an Internet connection.

My understanding is that references to xsd documents at some other server are typically there so that a developer can retrieve the document during development but during system run-time validation one would be wise to have a local copy of a schema since it would not be prudent to hang production simply because the remote server was unreachable. Is this correct?

So then if that’s the case, does xsd expect me to both reference the remote base xsd schema, but also the name and location of some local copy of the schema? Or is such a reference not needed in my new schema file? Hope that makes sense. Thanks.

  • 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-26T23:59:09+00:00Added an answer on May 26, 2026 at 11:59 pm

    To reference another schema it is a convention to have that schema local to the “main” schema you are referencing it from. For example, to import a schema which defines some re-usable types:

    <xs:import namespace="http://CommonTypesNamespace/CommonTypes" 
               schemaLocation="CommonTypes.xsd"/>
    

    This is basically saying that there exists a schema called CommonTypes.xsd which will be found in the same directory as my main schema. The schemaLocation attribute is used as a relative path to the actual schema file from my referencing schema (NOTE: It’s also completely optional – see my note at bottom of this answer).

    To use the types inside CommonTypes.xsd, I first add the common types namespace in my main schema declaration:

    <xs:schema targetNamespace="http://MyNamespace/MyTypes" 
               xmlns:xs="http://www.w3.org/2001/XMLSchema"
               elementFormDefault="qualified" 
               xmlns:common="http://CommonTypesNamespace/CommonTypes">
    

    This is saying that I want to make the types from my common schema available in my main schema using the namespace prefix “common”.

    Then, for example, to reference an “Address” common type:

    <xs:element name="DeliveryAddress" type="common:AddressType" />
    

    This says that my delivery address type is actually the same type as AddressType defined in the common types schema.

    Note: schemaLocation can also be used with URI’s, absolute or UNC paths, or not at all because it’s an entirely optional attribute. If you don’t use schemaLocation your parser will most likely scan local directories looking for a schema with the correct namespace defined, but this is dependent on implementation.

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

Sidebar

Related Questions

I am writing some new code that will throw a custom exception - I
I am writing a new script that creates aliases based on the results of
Typically when writing new code you discover that you are missing a #include because
When writing a new jQuery plugin is there a straightforward way of checking that
I'm writing a new daemon, which will be hosted on Debian Linux. I've found
I'm thinking of writing a new web-based game, and wondered if anyone had any
I'm writing a new application in ASP.NET MVC. I've created a custom MembershipProvider that
We are writing a new application, and while testing, we will need a bunch
I'm a student just learning xml and c#. I'm writing a program that will
I am writing a new program and it will require a database (SQL Server

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.