XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
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 15:33 +0800, Graham Hannington wrote:
> [...]

> 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

No. In this case they should look at the confluence.xsd part. For
example, if your XML document was hosted at
http://www.example.org/docs/argyle.xml, then the XML Catalog would be
consulted for http://www.example.org/docs/confluence.xsd.

See http://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/#schema-loc :

The semantics of schemaLocation are that the first item is the namespace
name and the second is the location of a schema document providing
definitions for names in that namespace. But this does not mean such a
schema document is the _only_ schema, or an _authoratative_ schema
desrcibing names in that namespace. There is no such thing as a schema
defining a namespace, because XML doesn't have that concept -- a
namespace is just a URI that you can associate with names in XML
documents if you like.


[...]

> Also this:
> 
> > There is no direct mapping between namespace URIs and Schema documents

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

See the "chameleon" schema pattern for a counter-example.
Second, a Schema Document can be comprised of multiple xsd files.
Neither I nor the XSD spec uses Schema Document to mean a single xsd
file.

> I hope you don't think that I'm challenging you. That's not my intention. 

It wouldn't be a problem if you were, it's OK :-)

On the other hand it's 4am so I might not be all that coherent...

Liam

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