Default value for Element Vs Attribute

XML Schema Part 0: Primer has two contradicting statements:

2.2.1 Occurrence Constraints 

quote: "In summary, the differences between element and attribute defaults can be stated as: Default attribute values apply when attributes are missing, and default element values apply when elements are empty. "



quote: Element{ (minOccur=0, maxOccur= 1) fixed = -, default 37}  Attribute{ use = optional, fixed = -, default = 37 } Notes: element/attribute may appear once; if it does not appear its value is 37, otherwise its value is that given  


Which one is correct for the elements? I believe the first statement is true for elements, but the statement in the table is wrong.


Best Regards,

Venkateswar

Received on Thursday, 30 October 2003 14:14:27 UTC