W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > April to June 2000

Re: ANN: XML Schema Compilation Project on SourceForge

From: Rick JELLIFFE <ricko@geotempo.com>
Date: Sat, 22 Apr 2000 01:00:56 +0800
Message-ID: <39008948.A1033904@geotempo.com>
To: "Arnold, Curt" <Curt.Arnold@hyprotech.com>
CC: ",'xml-dev-temp@egroups.com'" <xml-dev-temp@egroups.com>, "'sml-dev@egroups.com'" <sml-dev@egroups.com>, "'reldeve@egroups.com'" <reldeve@egroups.com>, "'www-xml-schema-comments@w3.org'" <www-xml-schema-comments@w3.org>, "'simonstl@simonstl.com'" <simonstl@simonstl.com>
"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

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:49:52 UTC