[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Non-deterministic content model
- From: Francis Norton <francis@redrice.com>
- To: Robin Cover <robin@isogen.com>
- Date: Fri, 15 Jun 2001 08:29:25 +0100
Robin Cover wrote:
>
> On Thu, 14 Jun 2001, Marcus Carr wrote:
>
> >
> > Sam Willmott from OmniMark released a white paper on content model algebra
> > in the early nineties. He concluded that there was only one content model
> > that cannot be disambiguated and I have yet to see proof to the contrary.
> > The model is:
> >
> > (x, (y, x)*, y?)
> >
I'm trying to iterpret this interesting theory thread in the light of
existing validation technologies.
Taking the chess moves interpretation, the ambigous model above can be
implemented in Schematron as:
<sch:schema xmlns:sch="http://www.ascc.net/xml/schematron">
<sch:title>chess</sch:title>
<sch:pattern name="game">
<sch:rule context="game">
<sch:assert test="*[1][self::white]"
>The game must start with a white move.</sch:assert>
<sch:assert test="count(*) = count(white) + count(black)"
>The game may contain only black and white moves.</sch:assert>
</sch:rule>
<sch:rule context="white">
<sch:assert test="not(preceding::*[1][self::white]"
>White moves must alternate with black moves.</sch:assert>
</sch:rule>
<sch:rule context="black">
<sch:assert test="not(preceding::*[1][self::black]"
>Black moves must alternate with white moves.</sch:assert>
</sch:rule>
</sch:pattern>
</sch:schema>
Is it equally simple to implement this ambiguous model in other schema
technologies?
Francis.