AnonymousOne wrote:
When creating
an XML schema file, the default extention is XSD. How is it that schemas
can be accessed using only their XMLNS name (which does NOT include the
XSD extension)? If I enter the XMLNS attribute into a browser, I get
HTML pages - how are parsers resolving this? I've come across the
"xsi:schemaLocation" attribute, but this is cumbersome to use, and
appears to be unnecessary.
I think you need to provide some context. Are you using any XML editor
to create schema files that then uses the .xsd extension?
I think you are getting confused that namespace names look like URLs but
do not necessarily lead to a resource on a web server. For instance the
namespace for XSLT is
http://www.w3.org/1999/XSL/Transform
but so far if you try to load that URL you only get a placeholder, there
is so far no schema for that namespace and even if there was one it
would not necessarily be located at that URL.
So while namespace names often look like URLs (mostly to have a
world-wide unique name) there is not necessarily a resource at that URL
that is a schema for that namespace.
In general you need some way to tell the XML parser where the schema for
a certain namespace is, the schemaLocation attribute is one way but
often the parser API simply allows you to associate namespaces with
schema URLs before you run a validation.
--
Martin Honnen
http://JavaScript.FAQTs.com/