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?

Hi Amy,
    Thanks for the insightful points.

On Fri, Mar 13, 2020 at 6:33 PM Amelia A Lewis <amyzing@talsever.com> wrote:
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.

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


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?

I had reported my <xs:include> URI resolution findings for Xerces-J by using the Xerces sample jaxp.SourceValidator [1]. This seems to ignore the XSD instruction, <xs:include schemaLocation=""/>. It doesn't present a warning like Saxon does, that "" could be a reference to the including XSD document.

It seems that, for XSD validation with Xerces-J, we can customize the URI resolution method for <xs:include>, <xs:import> etc. I guess, we can use an API like [2] (I haven't used this much before. I'm answering only by looking at Xerces-J docs).

[1]  http://xerces.apache.org/xerces2-j/samples-jaxp.html#SourceValidator
[2]  http://xerces.apache.org/xerces2-j/javadocs/api/javax/xml/validation/SchemaFactory.html#setResourceResolver(org.w3c.dom.ls.LSResourceResolver


Mukul Gandhi

[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