W3C home > Mailing lists > Public > xmlschema-dev@w3.org > February 2004

Re: attribute declaration having use=required and a fixed value

From: Henry S. Thompson <ht@inf.ed.ac.uk>
Date: Fri, 13 Feb 2004 09:30:28 +0000
To: "Zafar Abbas" <zafara@microsoft.com>
Cc: <xmlschema-dev@w3.org>
Message-ID: <f5bvfmbjphn.fsf@erasmus.inf.ed.ac.uk>

"Zafar Abbas" <zafara@microsoft.com> writes:

> I have a question about the following text in the 'Xml Schema Part 1'
> regarding schema attribute declarations:
>
> ---
> Attribute Declaration Representation OK:
> ...
> 2 If default and use are both present, use must have the *actual value*
> optional.
> ---
>
> Does the same rule apply to fixed values?

No.

> Is the following attribute declaration allowed?

Yes.

> If it is, what should be the behavior during instance validation?

> <xs:attribute name="att" use="required" fixed="37" />

The relevant element info items must have an 'att' attribute, which
must have the *actual value* 37.  In otherwords, the document must
contain

   att="37"

since you have defaulted the type to anySimpleType.

ht
-- 
 Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
                     Half-time member of W3C Team
    2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
            Fax: (44) 131 650-4587, e-mail: ht@inf.ed.ac.uk
                   URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
Received on Friday, 13 February 2004 04:30:30 GMT

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