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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] How to redesign W3C XML Schema (Water Contract)

[ Lists Home | Date Index | Thread Index ]

>> Mike Plusch wrote:
>> I recommend folks look at Water Contract.
>> http://www.waterlang.org/water_book_2002/ch05.pdf

> Rick Jelliffe wrote:
>If Water Contract is simpler than Schematron, it is only because
>apples are simpler than oranges.

Actually, Water Contract can use arbitrary expressions (predicate
calculus)
written in XML, so it will be extremely difficult (impossible?)
to find a problem that can not be handled by Water Contract.

Water Contract is probably more flexible and expressive than
any of the alternative schema languages because you can define
your own types as well as execution semantics for custom control
structures such as rule-based systems, etc.

>For example, here is a typical Schematron pattern (untested), that
the number
>of columns in any table should not exceed the cols attribute:
>
><rule context="tr">
>    <assert test="count(td) &lt;= ../table/@cols">
>    The number of columns in a table should not exceed the number in
the cols attribute.
>    </assert>
></rule>
>
>What is the equivalent in Water Contract?

Here's a definition that simply sets the 'cols' to the maximum length
of all the rows, therefore eliminating the need to verify it.

<defclass table cols=rows.<max_length/> rows='from_content' />

Max length could be defined as:

<defmethod max_length>
 <maximum rest=rows.<for_each> value.<length/> </> />
</defmethod>

Here's a Water Contract that verifies that the 'cols' attribute
is more than or equal to the number of columns in each row:

<defclass table cols rows='from_content'
   _precond=<assert> .cols.<more_or_equal rows.<max_length/> </>
/>

Here's one that defines a tall_table where the number
of rows must be more than the maximum number of
cells in any row:

<defclass tall_table rows='from_content'
   _precond=
      <assert> rows.<max_length/>.<more rows.<length/>/>
      </assert>
/>

> and why is it less complex to anyone who already knows XPaths?

XPaths is quite complex and not many people know it.
I think that many people would welcome a major simplification
to XPath.

><rule context="tr">
>    <assert test="count(td) &lt;= ../table/@cols">
>    The number of columns in a table should not exceed the number in
the cols attribute.
>    </assert>
></rule>

>... (much fulminating deleted)

Thanks for not fulminating.  I am sincerely trying to present
an alternative that solves many of the problems that people
bring up on this mailing list.

The set of Water Solutions tackle most (if not all) of the
issues that are brought up on this mailing list.  It is a major
innovation that people should consider more seriously rather
than just try to dismiss it.

_Mike


"The first-generation of the Web succeeded because of the
simplicity of URI, HTTP, and HTML.  The current generation
of the Web is mired in complexity, and a simple solution
will likely form the base for the next generation of the Web."
--Mike Plusch





 

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

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