Re: Question on use="required"

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).

Cheers,

Jeni

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

---
Jeni Tennison
http://www.jenitennison.com/

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