This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 4565 - Default attribute values not always applied
Summary: Default attribute values not always applied
Status: CLOSED FIXED
Alias: None
Product: XML Schema
Classification: Unclassified
Component: Structures: XSD Part 1 (show other bugs)
Version: 1.0/1.1 both
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: C. M. Sperberg-McQueen
QA Contact: XML Schema comments list
URL:
Whiteboard:
Keywords: resolved
Depends on:
Blocks:
 
Reported: 2007-05-17 16:57 UTC by Sandy Gao
Modified: 2009-04-21 19:21 UTC (History)
0 users

See Also:


Attachments

Description Sandy Gao 2007-05-17 16:57:41 UTC
Section 3.4.5 of the structures spec currently reads

"For each attribute use in the {attribute uses} whose {required} is false and whose {value constraint} is not ·absent· ..."

Consider a global attribute declaration:

  <attribute name="a" default="xyz"/>

And a reference to this global declaration:

  <attribute ref="a"/>

In this case, the attribute declaration has a default value, but the reference (hence the attribute use) doesn't. Strictly following 3.4.5, "xyz" is *not* applied when "a" is missing in the instance. Intended?

Shouldn't 3.4.5 refer to the "effective value constraint" as opposed to "whose {value constraint}"?
Comment 1 Sandy Gao 2007-05-25 13:41:50 UTC
Discussed at 2007-05-18 telecon. Adopted the following proposal.

- When applying default attributes, look at {value constraint} of both the attribute use and its attribute declaration (by referring to the "effective value constraint" term).