OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: XSchema Spec - Attribute Declarations (Section 2.4), Draft 4

[ Lists Home | Date Index | Thread Index ]
  • From: rbourret@dvs1.informatik.tu-darmstadt.de (Ron Bourret)
  • To: xml-dev@ic.ac.uk
  • Date: Mon, 13 Jul 1998 13:24:10 +0200

> 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@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS