[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 352
  • Last Modified:

Questions about XSD

when the xs:schema element uses http://www.w3.org/2001/XMLSchema,

is there any actual information used from that URL or is it importantly to declaratively assert the format of the XML?  If it is to define the document, where does an assertion take place to verify that the URL is in fact used?

Curious.
0
newbieweb
Asked:
newbieweb
  • 2
1 Solution
 
Geert BormansCommented:
It is important to know that "http://www.w3.org/2001/XMLSchema" is a URI, not a URL.
A URI is a unique string to identify a resource, in this case an XML namespace.
There is a practical reason why the "unique string" takes the form of a URL (web location). Since the owner of the domain can assume that no one else will use his domain to form a URI.
But that is the confusing part. Though a URI is nothing but a string identifier, people think there should be something at the other end.... and sometimes something can be found there
(for that reason my URIs are most often of a form like this "urn:company:project..."

An XML namespace is a way to bind a construct to a certain vocabulary. Similar to how programming languages such as Python or Ruby bind methods to a certain module.
In this question "http://www.w3.org/2001/XMLSchema" is the identifier of the XSD schema namespace. It is bound to the "xs:" prefix. You will have a namespace node like this
xmlns:xs="http://www.w3.org/2001/XMLSchema"
it just says that each element prefixed with "xs:" is part of the schema namespace, such as xs:schema for example

A schema parser knows the string (it is a hard wired identifier string inside the parser).
It will not lookup the address for anything, and it will not check that the URL is used... since it is a URI, not a URL, it is a URI that happens to have a URL syntaxt

I hope this helps

Geert
0
 
newbiewebAuthor Commented:
Thanks!

Great answer!!!
0
 
Geert BormansCommented:
welcome
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now