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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:57:49+00:00 2026-05-28T05:57:49+00:00

<?xml version=1.0 encoding=UTF-8?> <beans xmlns=http://www.springframework.org/schema/beans xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:aop=http://www.springframework.org/schema/aop xmlns:context=http://www.springframework.org/schema/context xsi:schemaLocation=http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.1.xsd>

  • 0
<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xmlns:context="http://www.springframework.org/schema/context"

       xsi:schemaLocation="http://www.springframework.org/schema/beans
           http://www.springframework.org/schema/beans/spring-beans.xsd
           http://www.springframework.org/schema/aop
           http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
           http://www.springframework.org/schema/context
           http://www.springframework.org/schema/context/spring-context-2.1.xsd">

  <context:component-scan
      base-package="com.springinaction.chapter01.knight" />

</beans>

The above example shows an example of an XML file with several namespaces. What is the purpose of these namespaces and most importantly why do they work even where there is no Internet connection?

I think the second bit that starts with xsi:schemaLocation contains the XML schema files which are used to validate the structure of the XML document. How come these still work if I run the application that uses this configuration file on a machine that is not on a network? Are the URLs somehow aliases to JAR files?

  • 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-28T05:57:51+00:00Added an answer on May 28, 2026 at 5:57 am

    Let us assume we have this XML document.

    <?xml version="1.0" encoding="UTF-8"?>
    <html>
          <body>
            Your text here
          </body>
          <body>
            <height>182 cm</height>
            <weight>83 kg</weight>
          </body>
    </html>
    

    It includes HTML which has a body tag with a semantic meaning for a HTML renderer. It also has another body tag which carries information about a specific person. A namespace defines a semantic scope for this tag. Without a namespace(as in the example provided), it is impossible for a parser to tell the difference because they are syntactically the same.

    Here is the semantically correct version of the same document:

    <?xml version="1.0" encoding="UTF-8"?>
    <html:html xmlns:html="http://www.w3.org/TR/xhtml1/">
      <html:body>
        Your text here
      </html:body>
      <human:body xmlns:human="http://www.example.com/human/">
        <human:height>182 cm</human:height>
        <human:weight>83 kg</human:weight>
      </human:body>
    </html:html>
    

    Thus thanks to namespaces we do not have worry about conflicting tags with different meanings.

    The namespace URIs themselves are never actually resolved, and are arbitrary (thus you can use them offline).

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

Sidebar

Related Questions

<?xml version=1.0 encoding=UTF-8?> <beans xmlns=http://www.springframework.org/schema/beans xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:p=http://www.springframework.org/schema/p xsi:schemaLocation=http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd> <bean id=viewResolver class=org.springframework.web.servlet.view.InternalResourceViewResolver p:prefix=/WEB-INF/jsp/ p:suffix=.jsp
<?xml version=1.0 encoding=UTF-8?> <beans xmlns=http://www.springframework.org/schema/beans xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:context=http://www.springframework.org/schema/context xmlns:p=http://www.springframework.org/schema/p xsi:schemaLocation= http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd> <!--
<?xml version=1.0 encoding=UTF-8?> <beans xmlns=http://www.springframework.org/schema/beans xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:context=http://www.springframework.org/schema/context xmlns:p=http://www.springframework.org/schema/p xmlns:tx=http://www.springframework.org/schema/tx xsi:schemaLocation= http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
Here is my bean.xml <?xml version=1.0 encoding=UTF-8?> <beans xmlns=http://www.springframework.org/schema/beans xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:context=http://www.springframework.org/schema/context xmlns:p=http://www.springframework.org/schema/p xmlns:tx=http://www.springframework.org/schema/tx xsi:schemaLocation=
Here is my security-context.xml file <?xml version=1.0 encoding=UTF-8?> <beans xmlns=http://www.springframework.org/schema/beans xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:sec=http://www.springframework.org/schema/security xmlns:aop=http://www.springframework.org/schema/aop xsi:schemaLocation=http://www.springframework.org/schema/beans
here is my web.xml : <?xml version=1.0 encoding=UTF-8?> <web-app version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee xmlns:xml=http://www.w3.org/XML/1998/namespace xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
Here are the excerpts of my Spring context .xml file. <?xml version=1.0 encoding=UTF-8?> <beans:beans
I have an XML file that looks like <?xml version='1.0' encoding='UTF-8'?> <root> <node name=foo1
I am trying to parse the following XML with javascript: <?xml version='1.0' encoding='UTF-8'?> <ResultSet>
I created an App.config file in my WPF application: <?xml version="1.0" encoding="utf-8" ?> <configuration>

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.