W3C home > Mailing lists > Public > xmlschema-dev@w3.org > December 2000

Re: [Moderator Action] How to define an element which must have a value?

From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
Date: 15 Dec 2000 09:49:40 +0000
To: Jingkun Hu <hujingkun@yahoo.com>
Cc: xmlschema-dev@w3.org
Message-ID: <f5bzohyhv4b.fsf@cogsci.ed.ac.uk>
Jingkun Hu <hujingkun@yahoo.com> writes:

> I roughly searched the archive of xmlschema-dev. And I
> didn't find a solution to how to define an element
> which must have a valid value. For example, <element
> name="birth-date" type="date">, here if a valid value
> is required (null is not accepted for this element),
> how to specify it? 
> 
> Can I say it nullable="false" by adding an attribute?
> if not what are the other ways?

I'm not sure I understand the question.  'nullable' is false by
default, so for simpleTypes (such as 'date') which do not allow the
empty string, valid instances of elements declared as having such
types, as in your example above, _must_ have valid content to be
valid.

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/
Received on Friday, 15 December 2000 04:49:43 GMT

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