W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > January to March 2000

Re: Why are element and type needed both?

From: timo harmo <harmo@valt.helsinki.fi>
Date: Sun, 06 Feb 2000 11:51:39 +0200
Message-ID: <389D442B.2E6@valt.helsinki.fi>
To: www-xml-schema-comments@w3.org, timo.harmo@helsinki.fi
I share Stefan's lack of understanding of the need for types and
elements both. I also have other some other deep deficiencies in my
I think it is nice to be able to use attribute-syntax for text-only
elements, but otherwise I don't understand the point of attributes.
Also I have some trouble understanding the need to specify sequencies.

This lack of understanding is maybe shown in the sketch below

<element name="element">
  <element name="name" datatype="attribute"/>
   <comment>Attributes are here treated just as elements, only allowing
    shorter syntax (but not requiring it) </comment>
  <group comment="order=choice min=0 max=1 is defined as default below">
    <element name="datatype" datatype="attribute"/> 
    <element name="ref" datatype="attribute"/> 
  <element name="value" datatype="attribute" maxoccur="*"/>
  <element name="default" datatype="attribute"/>
  <group ref="contentmodel"/>
  <comment>having both ref and content means the content restricts the
   element - extension can maybe handled by using groups
  <element name="token" datatype="attribute/variablename">
      <comment>to allow variable names to be bound to values to do some
       programming.. ignore for now"</comment>

<element name="group">
  <element name="name" type="attribute"/>
  <element name="ref" type="attribute"/> 
  <comment>if ref is given, name is usually useless
    .. but doesn't hurt any. And at top level, ref could maybe give a
   that is extended by this group "</comment>
  <group ref="contentmodel"/>

<group name="contentmodel">
   <element name=order datatype="attribute/enum"
     value="seq" value="choice" value="repeat" default="choice"
     comment="oh dear, you are not supposed to use attributes like
that.. but it feels so goood"/> 
   <element name="maxoccur" datatype="attribute" default="1"/>
   <element name="minoccur" datatype="attribute/posint" default="0"/>
   <group maxoccur="*">
    <element name="comment" datatype=attribute comment=""/>
     <element ref="element" />
     <element ref="group"/>

Received on Sunday, 6 February 2000 04:51:47 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:49:52 UTC