Re: Feedback on candidate recommendation

Henry requested more details on the problem with the interaction
between import and substitution.  Volker's response follows.  -- P

  Date: Tue, 16 Jan 2001 19:18:06 +0100
  From: Volker Renneberg <volker.renneberg@acm.org>

The problem is how to check the document. The element tagged with
"start" can be found in schema 1 (uri_for_A). Afterwards the validator
steps down into "complextype" where the it finds a reference to
element B1 which resides in schema 2 (uri_for_B).

Now it depends on the validator implementation. My first version had a
_current_ schema (containing all the imported and included schemas)
which was passed to all methods. While stepping into an import (like
<element ref="B:B1"/>) it extracted the new "current" schema,
i. e. schema 2 (uri_for_B).

Doing this in a functional way means forgetting everything about
the surrounding schema 1 until the validator leaves
<element ref="B:B1"/>. Thus the declaration of
<element name="A1" equivClass="B:B1">
is not available when processing the data inside the "start" elements
(<A:A1>...</A:A1>)!!!

My solution for this problem means getting away from the hierarchical
view towards a plain list of all known schemas (1 -> schema 1 | 2 ->
schema 2 | ...). Additionally the number of the current schema and a
list of numbers describing the way down to the current schema are
provided. For example, while checking <A:A1>...</A:A1>, the current
schema number would be 2 and the list would be [1], because the
validator stepped from schema 1 to schema 2.

This solution allows to step back through all schemas and to look for
existing equivClass-declarations.

I hope this helps although it's a little bit difficult to describe.

> I passed on to the Schema working group your comments about
> difficulties you encountered implementing Schema.
> They asked for more details on the following comment:
> 
>   - interaction between equivalence classes and import:
>
>   <schema targetNamespace="uri_for_A" xmlns:B="uri_for_B">
>     <import targetNamespace="uri_for_B"/>
>     <element name="start">
>       <complextype>
> 	<element ref="B:B1"/>
>       </complextype>
>     </element>
>   
>     <element name="A1" equivClass="B:B1">
>       ...
>     </element >
>   </schema>
>   
>   <schema targetNamespace="uri_for_B">
>     <element name="B1">
>       ...
>     </element >
>   </schema>
> 
>   document:
>   <A:start xmlns:A="uri_for_A">
>     <A:A1>...</A:A1>
>   </A:start>

Received on Tuesday, 16 January 2001 13:56:03 UTC