The first style seems clearer assuming someone knows a default exists.
If one doesn't, then consistency makes the second clearer. This may
especially apply in the long term scenario where someone finds these
schemas in a (then) obsolete format: to me it seems more intuitive to
understand the second. Of course, if the first style is used, perhaps a
compromise would be to annotate the default values in the schema changes
section.
Regards,
Adam
--
Adam Rusbridge
DCC Development
HATII, University of Glasgow, Scotland
Tel: +44 (0)141 330 8591
Email: [log in to unmask]
Web: www.dcc.ac.uk
On 12/09/05 16:28, Priscilla Caplan wrote:
> Gee, actually the second is easier for me to read, as a human, because I
> don't have to look up what the default is.
>
> p
>
> Ray Denenberg, Library of Congress wrote:
>
>> Consider the following:
>>
>> <sequence>
>> <element name="a"/>
>> <element name="b" />
>> <element name="c" />
>> <element name="d" type="anyURI" />
>> <element name="e" maxOccurs="unbounded" />
>> <element name="f" minOccurs="0"/>
>> <element name="g" minOccurs="0" maxOccurs="unbounded"/>
>> .....
>>
>> It says: "elements a, b, c, d occur exactly once; e is mandatory and
>> repeatable, f is optional (not repeatable), g is optional and repeatable;
>> all are type string except d which is type anyURI."
>>
>> And consider:
>>
>> <sequence>
>> <element name="a" minOccurs="1" maxOccurs="1" type="string">
>> <element name="b" minOccurs="1" maxOccurs="1" type="string"/>
>> <element name="c" minOccurs="1" maxOccurs="1" type="string"/>
>> <element name="d" minOccurs="1" maxOccurs="1" type="anyURI" />
>> <element name="e" minOccurs="1" maxOccurs="unbounded" type
>> ="string" />
>> <element name="f" minOccurs="0" maxOccurs="1" type="string"/>
>> <element name="g" minOccurs="0" maxOccurs="unbounded"
>> type="string"/>
>> .....
>>
>> It says exactly the same thing. Which one is more readable? I.e. which
>> one of the two styles better facilitates comprehension?
>>
>> Why would you want to say it in the second form when you can say it in
>> the
>> first?
>>
>> Obviously my perspective is a bit different, that human readability is a
>> critical element in the ultimate success of these schemas -- Let the
>> machines do the hard work.
>>
>>
>> --Ray
>>
>
|