W3C home > Mailing lists > Public > xmlschema-dev@w3.org > October 2003

Default value for Element Vs Attribute

From: Venkateswar Wunnava <wvsvenkat@hotmail.com>
Date: Thu, 30 Oct 2003 11:06:37 -0800
To: <xmlschema-dev@w3.org>
Cc: "Venkateswar Wunnava" <wvsvenkat@hotmail.com>
Message-ID: <BAY2-DAV28Jo9n2LgHY0000ccf3@hotmail.com>
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,

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

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:03 UTC