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

  • Home
  • SEARCH
  • 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 8536423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:39:37+00:00 2026-06-11T10:39:37+00:00

What is the difference between an xs:group and an xs:sequence in XML Schema? When

  • 0

What is the difference between an xs:group and an xs:sequence in XML Schema? When would you use one or the other?

  • 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-06-11T10:39:38+00:00Added an answer on June 11, 2026 at 10:39 am

    xs:sequence – together with xs:choice and xs:all – is used to define the valid sequences of XML element in the target XML. E.g. the schema for this XML:

    <mainElement>
      <firstSubElement/>
      <subElementA/>
      <subElementB/>
    </mainElement>
    

    is something like:

    <xs:element name='mainElement'>
      <xs:complexType>
        <xs:sequence>
          <xs:element name="firstSubElement"/>
          <xs:element name="subElementA"/>
          <xs:element name="subElementB"/>
        </xs:sequence>
      </xs:complexType>
    </xs:element>
    

    xs:group is used to define a named group of XML element following certain rules that can then be referenced in different parts of the schema. For example if the XML is:

    <root>
    
      <mainElementA>
        <firstSubElement/>
        <subElementA/>
        <subElementB/>
      </mainElementA>
    
      <mainElementB>
        <otherSubElement/>
        <subElementA/>
        <subElementB/>
      </mainElementB>
    
    </root>
    

    you can define a group for the common sub-elements:

    <xs:group name="subElements">
      <xs:sequence>
        <xs:element name="subElementA"/>
        <xs:element name="subElementB"/>
      </xs:sequence>
    </xs:group>
    

    and then use it:

      <xs:element name="mainElementA">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="firstSubElement"/>
            <xs:group ref="subElements"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    
      <xs:element name="mainElementB">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="otherSubElement"/>
            <xs:group ref="subElements"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

System.out.println(matcher.group(1)); System.out.println(matcher.group()); I like to know what's the difference between the above two codes.
Difference between start-pointers and interior-pointers and in what situation we should prefer one over
The difference between Chr and Char when used in converting types is that one
Can any one explain difference between position and anchor point in cocos-2D with some
I'm a little fuzzy on what the difference between a "group" and a "capture"
I use the query below to detect a 10 centimeter difference between the average
Possible Duplicate: Is there any difference between Group By and Distinct What's the difference
Suppose a is a group of strings. I can not understand the difference between
What is the difference between a Group and a Match in .NET's RegEx?
I asked a related question ' Difference between process group id and job id

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.