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

RE: Question on use="required"

From: Dare Obasanjo <dareo@microsoft.com>
Date: Wed, 28 Aug 2002 20:10:35 -0700
Message-ID: <8BD7226E07DDFF49AF5EF4030ACE0B7E06621FCD@red-msg-06.redmond.corp.microsoft.com>
To: "Jeni Tennison" <jeni@jenitennison.com>, "Stefan Wachter" <Stefan.Wachter@gmx.de>
Cc: <xmlschema-dev@w3.org>, <www-xml-schema-comments@w3.org>

I have discussed the schema and instance below with a number of
implementers and testers at work with the consensus being that there is
an inconsistency or bug in the W3C XML Schema recommendation with
regards to how value constraints interact with attribute use. 

First of all it should be noted that both fixed and default are value
constraints[0]. The description for fixed implies that it adds to the
PSVI as given below 

"default specifies that the attribute is to appear unconditionally in
the post-schema-validation infoset, with the supplied value used
whenever the attribute is not actually present; fixed indicates that the
attribute value if present must equal the supplied constraint value, and
if absent receives the supplied value as for default." 

However although provisions are made to prevent use="required" and the
default value being present in the attribute declaration from
occuring[1] no similar provision is made for use="required" and the
fixed value being set. It is my opinion that this is likely an oversight
and clarification from the W3C XML Schema working group is needed. 

In writing the disputed conformance test we were of the opinion that
since fixed modifies the PSVI and inserts an attribute information item
where there was none before then having use="required" is redundant and
a NO-OP. 

[0] http://www.w3.org/TR/xmlschema-1/#a-value_constraint

> -----Original Message-----
> From: Jeni Tennison [mailto:jeni@jenitennison.com] 
> Sent: Wednesday, August 14, 2002 7:44 AM
> To: Stefan Wachter
> Cc: xmlschema-dev@w3.org
> > PS: So there is an error in the Microsoft testcase 
> > attribute/attP009.xsd. Theres is the complexType
> >
> >         <xsd:complexType name="attRef">
> >                 <xsd:attribute name="att" use="required" 
> fixed="37"/>
> >         </xsd:complexType>
> >
> > which is valid. But in the accompanying instance document 
> attP009.xml 
> > there is no value for the attribute.
> I haven't looked at it, but if it's as you describe then yes, 
> that's an error.

Don't be afraid to take a big step if one is indicated. You can't cross
a chasm in two small leaps.     

This posting is provided "AS IS" with no warranties, and confers no
Received on Wednesday, 28 August 2002 23:11:07 UTC

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