Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: Include multiple complex types into one element ...

From: "Michael Kay" <mike@--------.--->
To: "'Dragon Fly'" <dragon-fly999@-------.--->, <xmlschema-dev@--.--->
Date: 7/8/2008 8:56:00 PM
You can do this if you define the two content models not as named complex
types but as named model groups (xs:group name="x"). A named model group can
be incorporated by reference into any number of complex types.
 
Michael Kay
http://www.saxonica.com/


  _____  

From: xmlschema-dev-request@w... [mailto:xmlschema-dev-request@w...] On
Behalf Of Dragon Fly
Sent: 07 July 2008 18:16
To: xmlschema-dev@w...
Subject: Include multiple complex types into one element ...


Hi,

I'm new to XSD and was wondering if I could include multiple complex types
into one element.  For example, I have two complex types NameType and
AddressType.

=====

  <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
AddressType.  I was able to include them if I create "sub-elements" (i.e.
SubA and SubB below).  However, I just want the elements in NameType and
AddressType 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's a talkathon - but it's not just talk. Check out the i
<http://www.imtalkathon.com/?source=EML_WLH_Talkathon_JustTalk> 'm
Talkathon. 



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent