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] XML Schema: What does <include schemaLocation="" />mean?

On Fri, 13 Mar 2020 12:48:21 +0530, Mukul Gandhi wrote:

> According to you, does <xs:include schemaLocation="" /> in an XML schema
> document means, that it is an include of the including schema (i.e it is a
> recursive XML schema include)?

I don't believe that it's specified that "" is a reference to the 
current document, it's just that that interpretation is a consequence 
of other things that it does say. However, I can't point to where it's 
specified (because too lazy to go look it up). In code that I've 
written or maintained, that's how all the resolvers/catalog-resolvers 
work.

This is because the resolution of schemaLocation="path/path/filename" 
is taken as a relative URI from the base URI, which is (typically) the 
current document (unless overridden specifically). So the degenerate 
case of a relative URI is "", which when combined with base URI, is the 
current document (unless base URI is set to something else, in which 
case it's still base URI, but it's not the current document).

> I think otherwise, i.e I guess  <xs:include schemaLocation="" /> means an
> include of a null schema reference, and hence <xs:include schemaLocation=""
> /> should be ignored by an XML Schema validator. Please correct me, if I'm
> wrong.

Your alternative also seems reasonable, if that's how your resolvers 
work, but to do so you'd have to special case "". If you don't 
special-case it, then "" == base URI (because appending nothing to base 
URI has that effect). In your case, presumably you're treating it as an 
absolute (null) URI, rather than as a relative URI?

Hmmm. You mention a validator; I think this in general refers to schema 
parsing, not the validation stage. Presumably, you've already 
provisioned the validator before use (well, again, that's my 
experience; it may work differently in other codebases than the ones 
I'm most familiar with). So it would be more accurate to speak of the 
behaviors of the schema parser, rather than of the schema validator 
(again, possibly different code bases make this distinction 
insignificant).

Amy!
-- 
Amelia A. Lewis                    amyzing {at} talsever.org
About the use of language: it is impossible to sharpen a pencil with a 
blunt axe. It is equally vain to try to do it with ten blunt axes 
instead.
                -- Edsger Dijkstra


[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