RE: complexType's typedef

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 UTC