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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:26:41+00:00 2026-05-13T18:26:41+00:00

When you add an xml schema to a document like I understand that the

  • 0

When you add an xml schema to a document like I understand that the xmlns is not actually the location of the xsd file. Is this correct?

  • How do you in practice reference an xml file’s schema?
  • Is it usually on a web server? That would seem very chatty.
  • Is it referenced by relative path?
  • Is it not actually referenced in the xml but rather loaded into an xml parser arbitrarily?

Any feedback?

  • 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-13T18:26:42+00:00Added an answer on May 13, 2026 at 6:26 pm

    You have a schema with a target namespace and qualified elements (wich means you don’t have to prefix your elements to apply target namespace):

    <?xml version="1.0"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
            targetNamespace="http://www.exemple.com/my-namespace-URI"
            xmlns="http://www.exemple.com/my-namespace-URI"
            elementFormDefault="qualified">
        <-- Your schema definition -->
    </xs:schema>
    

    You have to include it in your root element. First the xml-schema namespace:

    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    

    (from here the xsi: prefix corresponds to this namespace)

    Then reference the schemaLocation attribute

    xsi:schemaLocation="http://www.exemple.com/my-namespace-URI my.xsd"
    

    where my.xsd is the location of the XSD file (by default relative to the XML document’s location). You can put a complete URL like

    xsi:schemaLocation="http://www.exemple.com/my-namespace-URI http://www.exemple.org/xml/my.xsd"
    

    So that gives your document:

    <?xml version="1.0"?>
    <doc xmlns="http://www.exemple.com/my-namespace-URI"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://www.exemple.com/my-namespace-URI http://www.exemple.org/xml/my.xsd">
        <!-- Document content -->
    </doc>
    

    Note that the XSD file URL is not necessarily related to the namespace URI.

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

Sidebar

Related Questions

The XML dataset file after I add it to a DataSet looks like this:
I have a document that transforms xml to word. it starts like this: <?xml
Hi I am trying to add a custom field to the Schema.xml of Document
How do I add a space in an XML schema element? I'd like to
The following code helps me validate an XML file with an XSD schema. XmlReaderSettings
So there's an XSD schema that validates a data file. It declares root element
I have an xml document that looks something like below (resources.xml), with a corresponding
I want to add an XML file, containing sensitive data, to my application. I
I want to add doctypes to my XML documents that I'm generating with LXML's
Given the following XML file: <?xml version=1.0 encoding=UTF-8?> <process name=TestSVG2 xmlns=http://www.example.org targetNamespace=http://www.example.org xmlns:xsd=http://www.w3.org/2001/XMLSchema> <sequence>

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.