Re: XML Schema Question

Jeni Tennison writes:

> My philosophy is that the main things that
> should influence the design of a markup language
> are (...): human readability, size, processing
> efficiency, and extensibility.


> It seems foolish to artificially constrain a 
> markup language because of the weaknesses of
> one particular schema language

I agree, for the most part.  On the other hand, I think you have perhaps 
underemphasized fidelity of the markup to the underlying semantics of the 
information to be processed.  Thus, independent of schema language,  one 
can argue that:

<list>
  <item>val1</item>
  <item>val2</item>
  <item>val3</item>
</list>

is more robust than:

<list>val1 val2 val3</list>

Tools like XQuery/XSL will have an easier time picking up the explicit 
markup of the more verbose form.  Though I can see it either way, one can 
make the case in that spirit for the following "improvement" to the 
example in question:

Original:

<family>
                 <father>Jack</father>
                 <mother>Jill</mother>
                 <son>Billy</son>
                 <son>Joey</son>
                 <daughter>Jane</daughter>
                 <pet>Fido</pet>
</family>

Suggested improvement:

<family>
  <parents>
                 <father>Jack</father>
                 <mother>Jill</mother>
  </parents>
  <children>
                 <son>Billy</son>
                 <daughter>Jane</daughter>
                 <son>Joey</son>
  </children>
  <pets>
                 <pet>Fido</pet>
  </pets>
</family>

Though I'm sure you would get differing opinions from various members of 
the XML Schema WG, I think it's fair to say that among the reasons we did 
not invest more in the "unordered sequences of elements with count 
controls on each element by name"-model was a feeling that in the majority 
of cases such markup is in fact undesirable.  We could have extended 
<xsd:all> to support this, but chose not to in release 1.0. We do 
occasionally get requests to add such function, but some of us remain 
unconvinced that it is a high priority.  You'll note that XML Schema can 
easily model my "improved" form, either using <xsd:sequence> (order of the 
sections matter) or <xsd:all> (if it doesn't).

In any case, independent of the schema language used, I think there are 
often better alternatives to examples such as the one that inspired this 
thread.


--------------------------------------
Noah Mendelsohn 
IBM Corporation
One Rogers Street
Cambridge, MA 02142
1-617-693-4036
--------------------------------------

Received on Tuesday, 24 August 2004 21:36:42 UTC