Re: ANN: XML Schema Compilation Project on SourceForge

"Arnold, Curt" wrote:
> 
> You are invited to join a project to an open-source XSLT-based compiler for XML Schema.

I welcome Curt's initiative. From his careful comments on the XML Schema
drafts, he seems a person with the technical awareness to keep something
like this on track.

And the news on the RELAX mailing list is also very heartening.

On the issue of XML Schemas being compiled into Schematron, I am
interested in knowing if anyone can come up with content models that
could not be validated by a Schematron schema automatically generated
from an XML Schema so that, for every unique particle in an element
complex type:
	1) an assertion statement is created for all the allowed successors of
that particle within that parent
	2) an assertion statement is created for all the allowed predecessors
of that particle within that parent
	3) an assertion statement is created giving the effective minOccurs of
that element within the whole type
	4) an assertion statement is created giving the effective maxOccurs of
that element within the whole type.

These simply derivable rules seem to validate most of the constraints in
most content models. But I can see a family of cases where these don't
capture everything: that is the case of particles repeated in different
contexts.  For example, a content model like
	( a{3-4}, b, a{5-6} ) 
would by the above translation rules have the assertions
 <rule context="x/a">
  <assert 
   test="following-sibling::b or following-sibling::a or
position()=count(parent::*/*)"
  >Allowed successors...</assert>
  <assert 
   test="previous-sibling::b or previous-sibling::a or position()=1"
  >Allowed predecessors...</assert>
 </rule>
  <rule context="x/b">
  <assert 
   test="following-sibling::a"
  >Allowed successors...</assert>
  <assert 
   test="previous-sibling::a"
  >Allowed predecessors...</assert>
 </rule>
  <rule context="x">
   <assert test="count(a) &gt; 7 and count(a) &lt; 11"
   >(max and min on a)</assert>
   <assert text="count(b) =1 "
   >(max and min on b)</assert>
but that corresponds to a slightly weaker content model:
   ( a,  (( b, a{7-10}) 
     ( a,  (( b, a{6-9}) 
      | ( a,  (( b, a{5-8}) 
       | ( a,  (( b, a{4-7}) 
        |( a,  (( b, a{3-6}) 
          |( a,  (( b, a{2-5}) 
            |( a,   b, a{1-4}) 
      ))))))))))))
i.e. 
	( a{1-7}, b, a{1-9} ) where a>7 and a<11

If we can find any convenient way to represent these kind of grouping
constraints (and other similar ones) then it is possible that the
approach based on assertions on two-step path models is more powerful
that grammars (for modeling constraints, which is only one of the things
that a schema language can be for: a schema language can also allow
naming of structures present according to some analytical paradigm such
as "type" or "pattern"). (Of course, if allowed an infinite number of
subcontexts within an assert, that would give us a better purchase (in
the mountaineering sense) but I am trying to resist that if possible.

If anyone has any ideas or inspiration on this (especially formal
approaches) then please feel free to email me or to continue this
discussion on Curt's mail list  XSDComp (where is seems to fit in).

Thanks
Rick Jelliffe

Received on Friday, 21 April 2000 12:54:24 UTC