[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: If I want to use catalogs for XSDs, must document instance

  • From: "Graham Hannington" <graham_hannington@fundi.com.au>
  • To: xml-dev@lists.xml.org
  • Date: Fri, 20 Apr 2012 15:33:25 +0800

Re:  If I want to use catalogs for XSDs
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. http://www.websense.com/



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.