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

Re: minOccurs and default

From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
Date: 28 Apr 2001 08:24:35 +0100
To: Tom Welch <twelch@fastlinepub.com>
Cc: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>
Message-ID: <f5bbsphxz9o.fsf@cogsci.ed.ac.uk>
Tom Welch <twelch@fastlinepub.com> writes:

> Is the following element guaranteed to create one and only one node when the
> node is not explicitly defined in the document using this schema?
> <element name="one" type="decimal" minOccurs="0" maxOccurs="3" default="1"/>

Element defaults are not like attribute defaults, in part because of
occurrence range issues.

The above construct will _never_ create an element node -- it will
simply fill in the value 1 for any _empty_ element in the
schema-processed infoset, e.g.


will have the same PSVI as


  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 Saturday, 28 April 2001 03:24:33 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:51 UTC