XML.com: XML From the Inside Out
oreilly.comSafari Bookshelf.Conferences.

advertisement

DSDL Interoperability Framework
by Eric van der Vlist | Pages: 1, 2, 3

4. The latest proposal

The two initial proposals (Schemachine and XVIF) were presented to the ISO DSDL working group in Baltimore (December 2002); although they were considered a valuable input, both were rejected, for different reasons:

  • Schemachine was considered "too procedural": its focus is on defining pipes, that is, defining the algorithm used to validate a document, while it would be more appropriate to focus on defining the rules to meet to consider that a document is valid.

  • XVIF was considered too intrusive: to fully support XVIF, the semantics of the different schema languages must be extended and the schema validators need to be upgraded. An interoperability framework should work with existing schema languages and processors without requiring any update.

To take these two requirements into account, a new proposal has been made which builds upon ideas from Schemachine and XVIF, but also from XSLT and Schematron. This proposal has been named "XVIF/Outie", after a joke from Rick Jelliffe. A description of XVIF/Outie can be found at http://downloads.xmlschemata.org/python/xvif/outie/about.xhtml and a prototype implementation is available.

4.1. xvif/outie basics

The basic ideas behind Outie are pretty simple:

  • Outie is all about defining assertions.

  • These assertions are schema validations applied on instance documents.

  • These instance documents can be the instance document presented for validation, other documents, or results of transformations.

  • Assertions about the same instance can be grouped into rules.

The basic building blocks of an Outie framework are rules. Each rule is about checking one and only one instance document. By default this instance document is the instance document presented for validation.

Other instance documents may be selected inline, by specifying a transformation to apply on existing instance or by reference, through a URL or reference to a variable. Global variables may be defined to store the result of transformation.

Rules may belong to a "mode" and rules for a mode are explicitly applied. Outie is purely declarative and side effect free: rules and variable definitions may appear in any order; the order in which rules and assertions are processed is not guaranted; variables which are not used may never been evaluated.

4.2. XVIF/Outie example

Here's an example that shows most of the features. We define that a document is valid if and only if it is valid after transformation by "normalize1.xsl" per the schemas "schema1.sch" and "schema1.rng" or if it is valid after transformation by "normalize2.xsl" per the schemas "schema2.sch" and "schema2.rng".

A framework to express this, using a variable to store the result of the transformation by "normalize2.xsl", could be:

 <?xml version="1.0" encoding="utf-8"?>
 <framework>
  <rule>
   <assert>
    <choice>
     <apply-rules mode="mode1"/>
     <apply-rules mode="mode2"/>
    </choice>
   </assert>
  </rule>
  <rule mode="mode1">
   <instance>
    <transform transformation="normalize1.xsl"/>
   </instance>
   <assert>
    <isValid schema="schema1.sch"/>
    <isValid schema="schema1.rng"/>
   </assert>
  </rule>
  <rule mode="mode2" instance="$instance2">
   <assert>
    <isValid schema="schema2.sch"/>
    <isValid schema="schema2.rng"/>
   </assert>
  </rule>
  <variable name="instance2">
    <transform transformation="normalize2.xsl"/>
  </variable>
 </framework>

4.3. More XVIF/Outie features

We have seen most of the features of Outie in this first example, let's review some of the more "hidden" aspects.

  • Outie is purely declarative and side effect free:

    • Rules and variable definitions may appear in any order.

    • The order in which rules and assertions are processed is not guaranted.

    • Variables which are not used may never been evaluated.

  • The tools to apply for a transformation or schema validation is implicit.

    • The choice of the tool is function of the document type.

    • The document type is assumed from the extension of the document.

    • Implementations need to provide a way to define the match between extensions and tools.

  • Schemas can also be the result of transformations.

To illustrate this last point, we can take the example of a schema created by the "getStage" transformation proposed by Bob DuCharme:

 <?xml version="1.0" encoding="utf-8"?>
 <framework>
  <rule>
   <assert>
    <isValid>
     <schema>

      <transform extension=".xsd" 
         instance="schema.xsd"
         transformation="getStage.xsl">
        <with-param name="stageName" 
          select="'final'"/>
      </transform>

     </schema>
    </isValid>
   </assert>
  </rule>
 </framework>

Or, using a variable:

 <?xml version="1.0" encoding="utf-8"?>
 <framework>
  <variable name="final">

   <transform extension=".xsd" 
      instance="schema.xsd"
      transformation="getStage.xsl">
    <with-param name="stageName" 
      select="'final'"/>
   </transform>

  </variable>
  <rule>
   <assert>
    <isValid schema="$final"/>
   </assert>
  </rule>
 </framework>

4.4. Perspectives

The intention for Outie is to get the approval of the ISO DSDL working group and, ultimately, to become an ISO DIS (Draft International Standard).

But first some issues need to be fixed:

  • Some transformations may split an instance document into several pieces, how do we address the different pieces in this case?

  • Should the format of the validation report be specified?

  • Should the format of the configuration file matching extensions and tools be specified?

More issues will probably be raised during the ISO meetings in London (May 2003), held during the XML Europe conference.

5. Conclusion

Xvif/Outie or something derived from it should become an ISO DIS. I am also committed to develop Xvif and its micro pipes. When Outie becomes more stable, I will make sure to find a convergence between the two Xvif flavors.



1 to 1 of 1
  1. Joke
    2003-05-05 06:36:47 Robin Berjon
1 to 1 of 1