W3C home > Mailing lists > Public > xmlschema-dev@w3.org > August 2002

Re: Question on use="required"

From: Jeni Tennison <jeni@jenitennison.com>
Date: Wed, 14 Aug 2002 12:54:43 +0100
Message-ID: <37167120827.20020814125443@jenitennison.com>
To: xmlschema-dev@w3.org, Stefan Wachter <Stefan.Wachter@gmx.de>

Hi Stefan,

> I have a question regarding attribute declarations whose use
> attribute has the value "required". Must there be values for such
> attributes in instance documents or is it also allowed to have a
> fixed/default values filled in?

The instance document must specify a value for the attribute [1]. I
*think* that you're not allowed to specify a default value for a
required attribute in the schema, because default values only apply
when the attribute is missing, and if it's required it can't be
missing, but I can't find the constraint specifying that at the
moment. You can have fixed values for required attributes, however
(particularly useful for indicating the version of a markup language).



[1] Clause 4 of http://www.w3.org/TR/xmlschema-1/#cvc-complex-type

Jeni Tennison
Received on Wednesday, 14 August 2002 07:54:45 UTC

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