|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XSchema Spec - Attribute Declarations (Section 2.4), Draft 4
> 2.4.3 Attribute Defaults > > XSchema requires attribute declarations to provide information about the > default value of a given attribute. XSchema provides for the four cases > supported by XML 1.0: #REQUIRED, #IMPLIED, #FIXED AttValue, and AttValue, > though they are expressed as choices between required and not required and > fixed or not fixed, with an optional default value. There may be only one > default value declaration per attribute. I used to think that Required, Fixed, and default value were orthogonal, that the XML naming scheme was confusing, and that this new scheme was wonderful. Then I looked at the possible combinations, half of which are illegal: Required Fixed AttValue XML 1.0 Value -------- ----- -------- -------------------------------- Yes Yes <value> #FIXED <value> Yes Yes -- error [1] Yes No <value> AttValue Yes No -- #REQUIRED No Yes <value> error [2] No Yes -- error [1] No No <value> error [2] No No -- #IMPLIED [1] Fixed=Yes without a value is clearly an error. [2] In XML, a default attribute value effectively implies that an attribute is required; that is, that it always has a value. Non-required defaults don't make sense, as they imply that an attribute can be missing (null in database terms) but, if present, use a default. XML has no concept of null-valued attributes, so non-required defaults are errors. What I realized is that the relationship between Required, Fixed, and AttValue is hierarchical, not orthogonal: Not required Required, no default Required with default Required with fixed default I like the wording of the current scheme, which is much clearer than XML's wording, but am leery that half the combinations are illegal. Should we change this to another syntax with no illegal possibilities (nothing equally clear comes to mind) or simply document the illegal combinations? -- Ron Bourret xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i... Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ To (un)subscribe, mailto:majordomo@i... the following message; (un)subscribe xml-dev To subscribe to the digests, mailto:majordomo@i... the following message; subscribe xml-dev-digest List coordinator, Henry Rzepa (mailto:rzepa@i...)
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








