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

Re: Providing a value for attributes defined with use="required"

From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
Date: 30 Nov 2000 12:59:15 +0000
To: Mike_Leditschke@nemmco.com.au
Cc: Gino Basso <GBasso@ware2.com>, xmlschema-dev@w3.org, xmlschema-dev-request@w3.org
Message-ID: <f5b1yvt4nvg.fsf@cogsci.ed.ac.uk>
Mike_Leditschke@nemmco.com.au writes:

> The attribute concerned is part of a versioning scheme. We require
> the attribute to ensure the sender warrants the version of the
> transaction being sent rather than relying on the schema providing
> one. The requirement for a single value is a cross check against the
> namespace specified which indirectly will imply a particular version
> of the transaction.
> 
> I had considered your option but want the generator of the transaction to
> explicitly indicate their intention.

You're right, you can't have what you want just using values of the
'use' and 'value' attributes.  The Primer is misleading in this
case.  Earlier versions of the XML Schema design allowed what you
want, but at some point we went back to doing only what DTDs do in
this regard.

Gino Basso correctly identifies the workaround: define a type with
only one valid member, and declare the attribute with that type and
use='require'.

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 Thursday, 30 November 2000 07:59:33 GMT

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