OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] If I want to use catalogs for XSDs, must documentinstances contain a schemaLocation?

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?

> 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 Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/

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

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS