W3C home > Mailing lists > Public > xmlschema-dev@w3.org > September 2003

Validate an element depending on the value of another element

From: Tobias Bunyan <tobias@findaproperty.com>
Date: Thu, 25 Sep 2003 14:06:22 +0100
Message-ID: <76E3C00CEF9CA34CA85BEEA25837A2F405E69C@hallmark.findaproperty.com>
To: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>

Hey there,

I'm new to xml-schema and have a couple of questions. If someone could point
me in the right direction I'd be grateful.

1. If I have a section of XML where one value has a different set of valid
entries depending on another is this possible to cover in xml-schema e.g.


If <type> is one, then <subtype> valid entries are 1, 2 and 3, but if <type>
is two, then <subtype> valid entries are 5, 6 and 7.

2.(I think this one may be due to badly formed XML). Can I use an attribute
from an element to validate child elements in different ways e.g.

<item class="person">

is valid but so is

<item class="car">
	<reg>ABC 123</reg>

Any help much appreciated

Received on Thursday, 25 September 2003 09:32:33 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:13 UTC