W3C home > Mailing lists > Public > xmlschema-dev@w3.org > January 2002

RE: complexType's typedef

From: Mark Feblowitz <mfeblowitz@frictionless.com>
Date: Fri, 25 Jan 2002 13:54:47 -0500
Message-ID: <4DBDB4044ABED31183C000508BA0E97F024D5791@fcpostal.frictionless.com>
To: "'wu.liu@verizon.com'" <wu.liu@verizon.com>, xmlschema-dev@w3.org
I'll try this one.

What you're doing is saying that elements first and second are required -
that there can be at least and at most one of each. You're declaring that
every thing of type MyStructType has a first and a second.

Derivation by restriction only allows you to tighten restrictions on a
definition, and you can't be any more constrained that minOccurs="1" and
maxOccurs="1". By removing the elements you've violated 


and by removing the sequence entirely, you've violated 


If you were to assign the sequence and the elements minOccurs="0", you are
saying that that these occur optionally (0 or 1 time), and so removing them
tightens the restriction to the tighter restriction of 0 or 0 times. That
should work.

Mark Feblowitz                                   [t] 617.715.7231
Frictionless Commerce Incorporated     [f] 617.495.0188 
XML Architect                                     [e]
400 Technology Square, 9th Floor 
Cambridge, MA 02139 

 -----Original Message-----
From: 	wu.liu@verizon.com [mailto:wu.liu@verizon.com] 
Sent:	Thursday, January 24, 2002 5:49 PM
To:	xmlschema-dev@w3.org
Subject:	complexType's typedef


I have 2 data structures:
struct MyStructType
      string      first;
      string      second;

typedef  MyStructType  MyTypedefType;

The corresponding datatype for MyStructType in schema is:
<complexType name="MyStructType">
            <element name="first" type=string"/>
            <element name="second" type="string"/>

But how to treat typedef? The following definition gives me error:
<complexType name="MyTypedefType">
      <restriction base="MyStructType "/>

Please advise.

Received on Friday, 25 January 2002 13:55:20 UTC

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