Question on Schemas

A

AnonymousOne

Greetings all,

I'm getting a little frustrated trying to figure this out. 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.
 
M

Martin Honnen

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.
 
H

Henry S. Thompson

Namespace owners _may_ make documents available for retrieval from
their namespace names. The W3C XML Schema spec. _allows_ processors
to dereference namespace names to see if there are schema documents or
RDDL documents or . . .

So e.g. at http://www.w3.org/XML/1998/namespace you will find an RDDL
document, which in turn will direct you to
http://www.w3.org/2001/xml.xsd if you want a schema document for that
namespace.

ht
--
Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
Half-time member of W3C Team
2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
Fax: (44) 131 650-4587, e-mail: (e-mail address removed)
URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,836
Latest member
login dogas

Latest Threads

Top