[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

  • From: rbourret@d... (Ron Bourret)
  • To: xml-dev@i...
  • Date: Mon, 13 Jul 1998 13:24:10 +0200

xml required
> 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!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.