Michael Kay <mike@saxonica.com> wrote on 07/29/2010 06:35:22 AM:
<snip/>
> By "on-demand" do you mean only during instance validation, when a
> component from the relevant namespace is first encountered? I think
> that's rather hard to achieve in practice. The schema processor
> typically converts the grammar for the content model of a complex type
> into a finite state machine, and you can't do that without knowing all
> the members of a substitution group, which you don't know until you've
> read all the schema documents. Also, it would mean that some errors in
> schemas (notably UPA violations) would not be found until you first used
> the schema with an instance document that triggered the appropriate checks.
>
> Some degree of incremental schema construction is implied by the spec,
> in the case where an instance document contains multiple
> xsi:schemaLocation attributes (e.g. an xsi:schemaLocation for the SVG
> namespace might be found on an svg:svg element deep within the
> document). But processors have some discretion here in what they allow;
> Saxon wouldn't allow such a late-arriving schema document, for example,
> to add new members to a substitution group that has already been used
> for validating previous elements.
Xerces-J does allow new substitution group members to be added later and will report UPA violations if there are any. It can even load more schema documents / components for namespaces it has already processed (e.g. for an element which matches a wildcard but has no definition in the currently known schema) if you enable it to do so.
> So for Saxon, as far as schema documents referenced using xs:import and
> xs:include are concerned, the answer is that they are processed eagerly.
> (The internal sequence of operations, whether schema documents are
> turned into schema components before all the imports/includes are
> processed, is another matter entirely and largely of no concern to the
> user.)
>
> Michael Kay
> Saxonica
>
> _______________________________________________________________________
>
> 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@lists.xml.org
> subscribe: xml-dev-subscribe@lists.xml.org
> List archive: http://lists.xml.org/archives/xml-dev/
> List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org