[Bug 3817] Processor profiles for following/not following schemaLocation

http://www.w3.org/Bugs/Public/show_bug.cgi?id=3817





------- Comment #6 from cmsmcq@w3.org  2007-03-21 17:06 -------
Perhaps we are imagining different uses for the terms defined here.  I
expect them to be used in describing processors, and the requirement
to be allowing the behaviors described in the initial description, in
comment #3, and in comment #5 to be described in English prose using
the terms defined in the spec.  

So to use the existing terminology to say that schema location hints
in the instance are not followed, it would suffice to say something
like

   Schema location hints in the document instance are not
   followed.

or

   The --nohints option means that the processor should not
   follow schemaLocation hints in the document instance, even if
   no components for the namespace in question are available.

If you want something more elaborate, I can offer the following sample
documentation for an imaginary processor named Figment which can be
invoked with run-time options directing the various behaviors
described.

... Figment schema construction options ...

Figment assembles a schema by looking for schema components in
different places.  In general, for each namespace used in the input
document as the namespace of any element or attribute, Figment looks
for schema components.

The user may control where Figment looks for components by means of
the --where and --how options:

  --where=LOCATION  

    LOCATION may be any of:  
      cache:  look in Figment's local schema cache
      cli:  look for a location passed on the command line, using
        the --load option
      ask:  ask the user by means of a prompt on stderr
      ns:  dereference the namespace name
      hints:  look in the locations indicated in xsi:schemaLocation
        attributes in the input

    The --where option can be given more than once on the command 
    line.  If no --where options are specified, the default behavior 
    of Figment is equivalent to --where=cache --where=hints --where=ns.
    If any --where options are specified, Figment will look only 
    in the indicated locations.

  --how=METHOD

    METHOD may be:
      literal: Figment will attempt to dereference the URI given 
        as a location.  If that produces a schema document, Figment
        will read the schema document and load the components it
        defines.
      catalog: means that Figment will look up the URI in the
        Oasis XML catalog at /usr/local/Figment/catalog and
        attempt to dereference the location given by the catalog,
        if any.
      rddl: means that if dereferencing a URI produces a RDDL
        document, Figment will look for the well-known purpose
        Figment-validation, and follow the link given.

    The --how option can be given more than once.  The order of
    options determines the order in which the methods are tried. 

    If --eager=yes is specified, then all methods will be tried 
    for each namespace; if --eager=no is specified, then later
    methods will be tried only if earlier methods don't succeed
    in finding a schema document.  The default is --how=catalog
    --how=literal --how=rddl

    The --how option does not affect searching in the Figment cache.

The --eager option controls what Figment does when it succeeds in
finding a schema document which defines components for the namespace
in question.

  --eager=yes means Figment will read and process the schema 
    document it has found, and then continue looking for more
    components in the namespace, using other methods or in other 
    locations, until there are no more places to look.  

  --eager=no means Figment will read and process the schema document
    it has found, and stop looking for components for the namespace.

The --onfailure option controls what Figment does when searching for
components for a given location fails to produce any schema documents
for the namespace being sought.

  --onfailure=continue means that Figment will try the next location
    on the list.
  --onfailure=halt means that Figment will stop looking for components
    for this namespace and move on to the next namespace
  --onfailure=error means that Figment will stop looking for 
    components, issue an error message, and move on to the next
    namespace 
  --onfailure=fatal means that Figment will stop looking for 
    components, issue an error message, and exit.  No validation will
    be performed.

These options can be used to produce a variety of behaviors.  The
following examples are drawn from discussions of schema construction
in public records of the XML Schema Working Group.

1) Unconditionally follow xsi:schemaLocation

   Applies to a processor that dereferences every supplied
   xsi:schemaLocation, and which reflects a (fatal) processor-specific
   error if any one or more such references fail to resolve to schema
   documents for the appropriate namespace.

   --where=hints --how=literal --onfailure=fatal

2) Conditionally follow xsi:schemaLocation

    Same as above, but no error is reflected if any one or more such
    references fail to resolve, resolve to something other than a
    schema document, or to a schema document for the wrong namespace.
    If any of those conditions occur, then that schemaLocation is
    treated as if it were not supplied.

    --where=hints --how=literal --onfailure=continue

3) Unconditionally ignore xsi:schemaLocation

    Applies to a processor which in all cases ignores
    xsi:schemaLocation attributes in instance documents.

This one can be achieved using any set of options that does not
include --where=hints.  For example:

    --where=cache

    --where=cache --where=namespace --how=catalog --how=literal
    --eager=yes --onfailure=continue

... End of Figment schema construction options ...

I think example 3) illustrates that what is requested in comment #3
and comment #5 is possible.  Or am I missing something?

Received on Wednesday, 21 March 2007 17:07:49 UTC