W3C home > Mailing lists > Public > xmlschema-dev@w3.org > September 2000

Defining an empty content type

From: Ian Stokes-Rees <ian@decisionsoft.com>
Date: Mon, 04 Sep 2000 16:36:05 +0100
Message-ID: <39B3C165.DE7EB7F8@decisionsoft.com>
To: xsdl <xmlschema-dev@w3.org>
I have a set of elements which I want to define with content="empty",
for a document where the simple presence of an element contains the
relevant information.  e.g.:

<tally>
<y/>
<a/>
<c/>
<a/>
<x/>
<y/>
</tally>

The XSD for this is as follows:

<complexType name="emptyElement" content="empty"/>

<element name="tally">
	<element name="a" minOccurs="0" maxOccurs="unbounded"
type="emptyElement"/>
	...
	<element name="z" minOccurs="0" maxOccurs="unbounded"
type="emptyElement"/>
</element>

Is it really the case that elements "a" to "z" are complex types?  I
think this is revealing the problem with the naming convention of
"simple" and "complex".  Surely my "emptyElement" type above should be
classed as "trivialType" rather than "complexType".

Perhaps this indicates a greater problem with the naming of "simple" and
"complex".  It is clear that the real distiction is between type that
can ONLY be applied to elements, and types which can be applied to
attributes and elements.  Here are some names which provide better
options:

elementOnlyType commonType -- clear distinction

basicType   advancedType  -- by definition basic can be used "anywhere"
(element and attribute), while "advanced" can only be used on elements.

eltOnlyType attrOnlyType  -- excludes the notion of assigning
attrOnlyType to an element

elementType attributeType -- lacks clarity that attributeTypes can be
assigned to elements

Regards,

Ian Stokes-Rees

-- 
ian.stokes-rees@decisionsoft.com          tel: +1865 203 192
DecisionSoft Ltd.                         fax: +1865 203 194
www.decisionsoft.com                      Oxford, UK, OX2 OEA
Received on Monday, 4 September 2000 11:36:22 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:18 GMT