W3C home > Mailing lists > Public > xmlschema-dev@w3.org > April 2009

How to defined flavors of a Schema

From: Dieter Menne <dieter.menne@menne-biomed.de>
Date: Fri, 3 Apr 2009 09:47:32 +0200
To: <xmlschema-dev@w3.org>
Message-ID: <000001c9b430$72601860$57204920$@menne@menne-biomed.de>

we are currently defining a format for medical data storage
(hrmconsensus.org). The full version is available

In the simplified example below, we have the always mandatory deviceTyp. For
patientsType, we would like to have a global conditional switch so that
three flavors are possible

-- minOccurs = "0" for internal clinical use
-- minOccurs = "1" for archiving, must contain patient info
-- minOccurs = "never" anonymized, must not contain patient info

I know that the latter is not possible, that conditionals are not supported
in XSL, and that Schematron would be an alternative.  Note that the
conditionals occur in several nesting levels, so that we cannot easily
combine versions of a master element with details, but they are always of
the type "may", "must", "must not".

We would like to avoid having several xsd files and prefer a common file
with branching. Any ideas or references to ideas are appreciated.

Dieter Menne on behalf of the hrmconsensus group.

<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="0.2">
	<xs:element name="xhrm">
				<xs:element name="device"
				<xs:element name="patients"
type="patientsType" minOccurs="0"/>
Received on Monday, 6 April 2009 09:23:04 UTC

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