[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Quick XML Schema question
- From: Eric van der Vlist <vdv@dyomedea.com>
- To: "XML Development Mailing List (E-mail)" <xml-dev@lists.xml.org>
- Date: Wed, 23 May 2001 08:17:06 +0200
Rick Jelliffe wrote:
>
> For this kind of constraint, you can use the Schematron assertion language.
> It can be embedded in XML Schemas <appinfo> annotations, extracted (there is
> a free XSLT script xsd2sch for this) and validated (using one of the
> Schematron validators).
>
> To give you an example of what this would look like:
> <xs:annotation>
> <xs:appinfo>
> <sch:rule context="mediaclip">
> <sch:assert test="@inpoint < @outpoint"
> >A mediaclip's inpoint should be numerically smaller
> than the out point. </sch:assert>
> </sch:rule>
> </xs:appinfo>
> <xs:annotation>
The assert clauses of Schematron are really powerful.
This is a feature that I have "borrowed" and included in Examplotron [1]
and you could write:
<mediaclip xmlns:eg="http://examplotron.org/0/"
inpoint="12" outpoint='24'
eg:assert="@inpoint < @outpoint"/>
For more complex clauses, one should note that the architecture of
examplotron is slightly different since the assertions are tested in the
match clauses of XSLT templates. This means that the XSLT "current()"
function that could be used in Schematron cannot be used in Examplotron.
Otherwise, you can pretty well copy/paste schematron clauses into
Examplotron.
Eric
[1] http://examplotron.org/
> Cheers
> Rick Jelliffe
--
See you in Berlin for XML Europe 2001:
http://gca.org/attend/2001_conferences/europe_2001/tutorialsmon.htm
------------------------------------------------------------------------
Eric van der Vlist http://xmlfr.org http://dyomedea.com
http://xsltunit.org http://4xt.org http://examplotron.org
------------------------------------------------------------------------