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

XML schema for ordinal/nominal variables

From: Christian Setzkorn <christian@setzkorn.eu>
Date: Mon, 4 Sep 2006 11:54:57 +0100
To: <xmlschema-dev@w3.org>
Message-ID: <001b01c6d010$8fcba560$a9d5fd8a@Zoonosis1>

Dear all,

I would like to define nominal/ordinal variables as XML schema. Both types
of variables are characterized by code/string pairs. Here code is a real
number.

Example of the nominal variable Gender:

code/string
#######
1/male
0/female

Example of the ordinal variable Agreement:

code/string 
#######
0/strongly disagree
1/disagree
2/agree
3/strongly agree

My first attempt to define 'Gender' is this:

<xs:element name = "gender" >
	<xs:simpleType>
		<xs:restriction base = "xs:string" >
			<xs:pattern value "0 female | 1 male" />
		</xs:restriction>
	</xs:simpleType>
</xs:element>

Could this be improved?

Any feedback would be very much appreciated. Many thanks in advance.

Best wishes,
 
Christian Setzkorn
 


-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.11.7/436 - Release Date: 01/09/2006
 
Received on Monday, 4 September 2006 14:16:45 GMT

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