[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Quick XML Schema question
- From: Rick Jelliffe <firstname.lastname@example.org>
- To: "XML Development Mailing List (E-mail)" <email@example.com>
- Date: Wed, 23 May 2001 15:02:36 +0800
From: Adam Van Den Hoven <Adam.Hoven@bluezone.net>
>I have a tag in my document that is something like
><mediaclip inpoint="12" outpoint='24' />
>Is there anyway for me to specify the requirement that the inpoint be
>numerically smaller than the out point.
No. You can only specify individual constraints, that the maximum or
minimum values of each be some sane constant.
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
To give you an example of what this would look like:
<sch:assert test="@inpoint < @outpoint"
>A mediaclip's inpoint should be numerically smaller
than the out point. </sch:assert>
If your data has quite a few of these kinds of interrelationships
that you need to check, it is probably worth the effort of using Schematron.
It is very ease to create ad hoc Schematron schemas, and add to them.
(If you only have a couple of constraints, or are not familiar with
XPaths, and don't have any XSLT processors installed, and you have expertise
in DOM already, it would be more straightforward to write your own
For some Schematron info, see http://www.ascc.net/xml/schematron