RE: Question on use="required"

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
[1]
http://www.w3.org/TR/xmlschema-1/#section-Constraints-on-XML-Representat
ions-of-Attribute-Declarations

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


-- 
PITHY WORDS OF WISDOM 
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
rights. 

Received on Wednesday, 28 August 2002 23:11:08 UTC