[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
Re: [xml-dev] If I want to use catalogs for XSDs, must document instancescontain a schemaLocation?
- From: "Graham Hannington" <graham_hannington@fundi.com.au>
- To: xml-dev@lists.xml.org
- Date: Fri, 20 Apr 2012 15:33:25 +0800
Liam,
Thank you very much for your quick and
informative response, it's much appreciated.
Regarding your statement:
> doing it based on namespace URIs
would not be a good way
I hope you don't think I'm splitting
hairs; I sincerely want to understand this...
Here's how I think it works. When an
XML document instance contains the following schemaLocation attribute:
xsi:schemaLocation="http://www.atlassian.com/schema/confluence/4/ac/confluence.xsd"
my understanding is that catalog-aware
XML applications (such as XMLSpy) look at the first part of that attribute
value*, match it with the value of the name attribute of the following
uri element in the catalog:
<uri name="http://www.atlassian.com/schema/confluence/4/ac/"
uri="confluence.xsd"/>
and then load the XSD referred to by
the uri attribute (uri="confluence.xsd").
* From the "XML Schema Part 0:
Primer Second Edition" (http://www.w3.org/TR/xmlschema-0/#schemaLocation)
> The schemaLocation attribute value
consists of one or more pairs of URI references, separated by white space.
The first member of each pair is a namespace name
That is, although an XML application
isn't doing it based on the value of xmlns: attributes (as you say: "Neither
should it."), it seems to me that it *is* doing it based on namespace
URIs (specifically, the first member of each pair of URI references in
a schemaLocation attribute value).
Am I just splitting hairs, or am I (as
I suspect) missing a deeper point here?
Also this:
> There is no direct mapping between
namespace URIs and Schema documents
Now - with apologies, I do not mean
to try your patience or waste your time; I do read and re-read the related
W3C documents, and some of it has sunk in - I really think I am missing
a deeper point here, because, as described above, I think a direct mapping
between a namespace URI and a schema document is exactly the process that
I've just described above, and is exactly what that uri element in a catalog
does:
<uri name="http://www.atlassian.com/schema/confluence/4/ac/"
uri="confluence.xsd"/>
If this uri element does not directly
map a namespace URI to a schema document, what does it do?
Finally:
> the relationship is that Schema
documents may define elements associated with one or more namespace URIs.
I'm not saying that you're asserting
otherwise, but I want to confirm that my current understanding in this
area is correct. I think that one schema document (XSD; a single .xsd file)
can define elements associated with only one namespace URI (its target
namespace). An XSD (again, I mean, specifically, a single .xsd file) can
use <import> elements to import element definitions associated with
other namespace URIs, but that is not quite the same as one XSD defining
elements associated with multiple namespace URIs. An XML vocabulary that
involves more than one namespace cannot be defined in a single .xsd file.
Am I correct? If not, could you please point me to, or provide, an example
of a single XSD that defines elements associated with more than one namepace
URI? (The XSD mentioned in my examples, confluence.xsd - which I wrote
- uses import elements to refer to two other XSDs.)
I hope you don't think that I'm challenging
you. That's not my intention. I am sincerely grateful for your initial
reply. Having gained your attention (and noting your signature line), I
am, without wanting to take up too much of your time, hoping to learn more.
And I am prepared to publicly expose my ignorance to do so :-).
Graham Hannington
Perth, Western Australia
Fundi Software Pty Ltd 2011 ABN 89 009 120 290
=
This message has been scanned for malware by Websense. www.websense.com
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]