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:59:57 -0500
Message-ID: <4DBDB4044ABED31183C000508BA0E97F024D5792@fcpostal.frictionless.com>
To: "'wu.liu@verizon.com'" <wu.liu@verizon.com>
Cc: cevans26@csc.com, "Xmlschema-Dev (E-mail)" <xmlschema-dev@w3.org>
That's a different meaning entirely. That means that you're accepting the
contents of MyStructType in the derivation, and adding nothing. So if you
create an element of type MyTypedefType, your instance document must contain
a first and a last or it will not be legal.




----------------------------------------------------------------------------
----
 
Mark Feblowitz                                   [t] 617.715.7231
Frictionless Commerce Incorporated     [f] 617.495.0188 
XML Architect                                     [e]
mfeblowitz@frictionless.com
400 Technology Square, 9th Floor 
Cambridge, MA 02139 
www.frictionless.com  
 

 -----Original Message-----
From: 	wu.liu@verizon.com [mailto:wu.liu@verizon.com] 
Sent:	Friday, January 25, 2002 1:43 PM
To:	Mark Feblowitz
Cc:	cevans26@csc.com
Subject:	RE: complexType's typedef
Importance:	High


Hi Mark,

Here is what we made it to work. Let us know if this correct or there is a
better way. Thanks!!!
============================================================================
<complexType name="MyTypedefType">
      <complexContent>
            <extension base="MyStructType "/>
      </complexContent>
</complexType>
============================================================================





Mark Feblowitz <mfeblowitz@frictionless.com> on 01/25/2002 01:34:09 PM

To:    WU LIU/EMPL/VA/Bell-Atl@VZNotes
cc:
Subject:    RE: complexType's typedef


Let's see if I can get this one right:




----------------------------------------------------------------------------

----

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


 -----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

Hi,

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">
      <sequence>
            <element name="first" type=string"/>
            <element name="second" type="string"/>
      </sequence>
</complexType>
=====================================================================

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

Please advise.

Thanks,
Wu
Received on Friday, 25 January 2002 14:00:32 GMT

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