W3C home > Mailing lists > Public > xmlschema-dev@w3.org > August 2001

Always use complexType/simpleContent/restriction?

From: Lemmin, Harald <Harald.Lemmin@softwareag.com>
Date: Wed, 29 Aug 2001 09:31:33 +0200
Message-ID: <DFF2AC9E3583D511A21F0008C7E62106172E18@softwareag.com>
To: xmlschema-dev@w3.org
Hello,

I automatically generate schemata and can use only simple types, but no
named types.
I want to model:
(a) an element (simple type) with an attribute.
(b) an element (simple type) with a facette.
(c) an element (simple type) with an attribute and a facette.

(c) can be modelled only with complexType/simpleContent/restriction:
	<element name="e" type="xs:string">
	  <complexType>
	    <simpleContent>
	      <restriction>
	        <length value="10"/>
	        <attribute name="a" type="xs:string">
	        </attribute>
	      </restriction>
	    </simpleContent>
	  </complexType>
	</element>

(a) can be modelled with complexType/simpleContent/restriction OR with
complexType/simpleContent/extension
(b) can be modelled with complexType/simpleContent/restriction OR with
simpleType/restriction

My questions are:
(I) Which solution to use in case (a) and (b)? Can I always use
complexType/simpleContent/restriction, like (c)??
(II) Is it ok to "restrict" an element (simple type) by an attribute, like
done in (c) [shouldn't it be an extension]? If not, how to model (c) without
named types?

Kind regards,
Harald
Received on Wednesday, 29 August 2001 03:31:46 GMT

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