Re: Error report: XML 1.0, 3rd ed., sec. 3.3.2

Dieter Köhler a écrit :
> In XML 1.0, 3rd ed., sec. 3.3.2 "Attribute Defaults" the case of a 
> default attribute not matching an enumaration is not considered.  Example:
> 
> <!ATTLIST list
>           type    (bullets|ordered|glossary)  "fancy">
> 
> There exists no VC which forbids this, because the VC Attribute Default 
> Value Syntactically Correct requires only that the default value meets 
> the "syntactic constraints of the declared attribute type", which is 
> Nmtoken in the case of Enumerations.  I would suggest adding to prod. 
> [60] a VC similar to VC Enumeration of prod [59].

Please take a look at erratum E9 to the Second Edition 
(http://www.w3.org/XML/xml-V10-2e-errata#E9), which resulted in the 
situation you now see in the Third Edition.  In a nutshell, your example 
is valid, until a <list> element appears in the instance without a 
"type" attribute; the validator then applies the default value "fancy", 
which is not valid.

The argument is that this is required for SGML compatibility and that 
this is actually what the makers of XML 1.0 wanted.  Please reply if you 
think otherwise, but be aware that errata can only fix actual errors in 
the spec, not undo what one might consider a bad design decision.

Regards,

-- 
François Yergeau

Received on Wednesday, 15 September 2004 19:43:51 UTC