W3C home > Mailing lists > Public > xmlschema-dev@w3.org > January 2002

Re: restriction

From: Jeni Tennison <jeni@jenitennison.com>
Date: Mon, 21 Jan 2002 11:44:49 +0000
Message-ID: <10073951857.20020121114449@jenitennison.com>
To: Oleg Tkachenko <olegt@multiconn.com>
CC: xmlschema-dev@w3.org
Hi Oleg,

> How can I restrict the following type to be "to" value >= "from"
> value?
>
> <xs:complexType name="unboundedRangeType">
>         <xs:all>
>                 <xs:element name="from" type="xs:unsignedLong" />
>                 <xs:element name="to" type="xs:unsignedLong" />
>         </xs:all>
> </xs:complexType>

This is an example of a "co-occurrence constraint". XML Schema cannot
articulate most co-occurrence constraints, including this one, so you
have to use another schema language instead. For this particular
co-occurrence constraint, you'd be best off with a language such as
Schematron or Examplotron that uses XPath to articulate low-level
rules.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/
Received on Monday, 21 January 2002 06:44:52 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:26 GMT