Print

Print


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