Altova Mailing List Archives


Re: [xml-dev] If I want to use catalogs for XSDs, must document

From: Liam R E Quin <liam@--.--->
To: Graham Hannington <graham_hannington@-----.---.-->
Date: 4/20/2012 6:07:00 AM
On Fri, 2012-04-20 at 12:29 +0800, Graham Hannington wrote:
> If I want a catalog-aware XML application (such as jEdit with XML plugin, 
> or Altova XMLSpy 2012) to use a catalog to locate XSDs to validate XML 
> document instances, must the XML document instances contain schemaLocation 
> attributes?
No.


> I had hoped that perhaps these applications might look at the xmlns: 
> attribute values (namespace URIs) in a document instance, and use the 
> catalog to map these namespace URIs to the location of the corresponding 
> XSD files, but that does not work for me in practice.

Neither should it.

There is no direct mapping between namespace URIs and Schema documents;
the relationship is that Schema documents may define elements associated
with one or more namespace URIs. It's a many*/many* relationship: an XML
document might not use any namespaces at all and yet still have one or
more XML Schema documents used to validate it. You might use any of
several schema documents (or several at once) depending on your goals.

> 
> So, either:
> - The answer is "yes" (the document instances must contain schemaLocation 
> attributes)
> - The answer is "no", and I'm doing something wrong in my catalog

The answer is that you have to tell your schema processor how to find he
schemas, and that schemaLocation attributes are one way, but not the
only way - the program might have another way to do it - but doing it
based on namespace URIs would not be a good way.

Liam

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/


_______________________________________________________________________

XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.

[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe@l...
subscribe: xml-dev-subscribe@l...
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.