Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6100231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:21:43+00:00 2026-05-23T13:21:43+00:00

Is this the proper way to set an attribute with enumerated values on the

  • 0

Is this the proper way to set an attribute with enumerated values on the complexType AvailStatusMessageType. I see a lot of examples that declare a complexContent section right below the complexType declaration? What is this complexContent for and is it necessary here?

<xs:complexType name="AvailStatusMessageType">
    <xs:sequence>
    <xs:element name="LengthsOfStay" type="LengthsOfStayType" />
    <xs:element name="RestrictionStatus" type="RestrictionStatusType"/>
</xs:sequence>
<xs:attribute name="BookingLimit">
<xs:simpleType>
    <xs:restriction base="xs:string">
        <xs:enumeration value="SetLimit" />
        <xs:enumeration value="AdjustLimit"/>
        <xs:enumeration value="RemoveLimit"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:21:44+00:00Added an answer on May 23, 2026 at 1:21 pm

    Element types can be divided into two categories in XML Schemas

    1. Elements that can contain structural markup (attributes or child elements)
    2. Elements that contain only textual markup

    Further, the elements that contain markup (group 1) can be again divided to two groups

    1. Elements that are allowed to have child elements
    2. Elements that are not allowed to have child elements

    First division separates (1) <complexType> and (2) <simpleType>. Second one separates (1) <complexContent> and (2) <simpleContent>.

    <xs:complexContent> is not usually seen, because it is an implicit default so the whole structure can be abbreviated by omitting that element. This common structure

    <xs:complexType>
      ... (<xs:sequence> or anything) ...
    </xs:complexType>
    

    is actually identical to

    <xs:complexType>
      <xs:complexContent>
        <xs:restriction base="xs:anyType">
          ... (<xs:sequence> or anything) ...
        </xs:restriction>
      </xs:complexContent>
    </xs:complexType>
    

    In your structure an element with type “AvailStatusMessageType” 1) contains markup 2) and has child elements. So your structure is a complex type with complex content. Your example seems correct even though you haven’t used the <xs:complexContent> element, because you are actually using the abbreviated form. It is identical to this:

    <xs:complexType name="AvailStatusMessageType">
        <xs:complexContent>
            <xs:restriction base="xs:anyType">
                <xs:sequence>
                    <xs:element name="LengthsOfStay" type="LengthsOfStayType" />
                    <xs:element name="RestrictionStatus" type="RestrictionStatusType"/>
                </xs:sequence>
                <xs:attribute name="BookingLimit">
                    <xs:simpleType>
                        <xs:restriction base="xs:string">
                            <xs:enumeration value="SetLimit" />
                            <xs:enumeration value="AdjustLimit"/>
                            <xs:enumeration value="RemoveLimit"/>
                        </xs:restriction>
                    </xs:simpleType>
                </xs:attribute>
            </xs:restriction>
        </xs:complexContent>
    </xs:complexType>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is this the proper way to detect which device a user is running? NSString
Would this be a proper way to dispose of a BackGroundWorker? I'm not sure
This might be a stupid question but if there's a better or proper way
This works, but is it the proper way to do it??? I have a
What is the proper way to use URL parameters? My URL is this: http://localhost:8080/#pg5?testing=abc
What is the proper way to set a timer in android in order to
Is there way to set an event on an InfoWindow that will notify me
This is good: import string string.capwords("proper name") Out: 'Proper Name' This is not so
This is likely by design for big teams with proper QA departments, but we
Maybe there is a proper term for this, but what if you want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.