Altova Mailing List Archives>Archive Index >xmlschema-dev Archive Home >Recent entries >Thread Prev - RE: default value for a simpleType with restriction >Thread Next - Re: Include multiple complex types into one element ... Include multiple complex types into one element ...To: <xmlschema-dev@--.---> Date: 7/7/2008 9:16:00 AM Hi=2C
I'm new to XSD and was wondering if I could include multiple complex types =
into one element. For example=2C I have two complex types NameType and Add=
ressType.
=====
<xs:complexType name="NameType">
<xs:sequence>
<xs:element name="FirstName" type="xs:string" />
<xs:element name="LastName" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="AddressType">
<xs:sequence>
<xs:element name="Country" type="xs:string" />
<xs:element name="Zip" type="xs:string" />
</xs:sequence>
</xs:complexType>
=====
I would like to create a root element that includes both the NameType and A=
ddressType. I was able to include them if I create "sub-elements" (i.e. Su=
bA and SubB below). However=2C I just want the elements in NameType and Ad=
dressType to be directly under RootInformation (without any sub-elements). =
Can that be done? Thank you in advance for your help.
<xs:element name="RootInformation">
<xs:complexType>
<xs:sequence>
<xs:element name="SubA" type="tns:NameType" />
<xs:element name="SubB" type="tns:AddressType" />
</xs:sequence>
</xs:complexType>
</xs:element>
_________________________________________________________________
It=92s a talkathon =96 but it=92s not just talk.
http://www.imtalkathon.com/?source=EML_WLH_Talkathon_JustTalk=
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
