OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   Re: ANN: XML Schema Compilation Project on SourceForge

[ Lists Home | Date Index | Thread Index ]
  • From: Rick JELLIFFE <ricko@geotempo.com>
  • To: ",'xml-dev@xml.org'" <xml-dev@xml.org>
  • Date: Sat, 22 Apr 2000 01:00:55 +0800

"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">
   test="following-sibling::b or following-sibling::a or
  >Allowed successors...</assert>
   test="previous-sibling::b or previous-sibling::a or position()=1"
  >Allowed predecessors...</assert>
  <rule context="x/b">
  >Allowed successors...</assert>
  >Allowed predecessors...</assert>
  <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}) 
	( 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).

Rick Jelliffe

This is xml-dev, the mailing list for XML developers.
To unsubscribe, mailto:majordomo@xml.org&BODY=unsubscribe%20xml-dev
List archives are available at http://xml.org/archives/xml-dev/


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS