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 6946649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:35:32+00:00 2026-05-27T13:35:32+00:00

I have an XSD schema that defines multiple elements in a document. Two sets

  • 0

I have an XSD schema that defines multiple elements in a document. Two sets of the elements I expect to be collections. One set of elements is defined like follow:

<xsd:element name="Prospects" minOccurs="0">
<xsd:complexType>
  <xsd:sequence>
    <xsd:element name="ROW" minOccurs="0" maxOccurs="unbounded">
      <xsd:complexType>
        <xsd:sequence>
          <xsd:element name="ID" type="xdv:guidKey" nillable="false" />
          <xsd:element name="Name" minOccurs="0">
            <xsd:complexType>
              <xsd:simpleContent>
                <xsd:extension base="xdv:stringLen50">
                  <xsd:attribute name="origVal" type="xdv:stringLen50" use="optional" />
                </xsd:extension>
              </xsd:simpleContent>
            </xsd:complexType>
          </xsd:element>
          ... more stuff...
    </xsd:element>
  </xsd:sequence>
  <xsd:attribute name="name" type="xsd:string" use="required" fixed="Prospects" />
  <xsd:attribute name="alias" type="xsd:string" use="required" fixed="Prospects" />
  <xsd:attribute name="keys" type="xsd:string" use="required" fixed="ProposalID" />
  <xsd:attribute name="codeTableColVal" type="xdv:codeTableColVal" use="optional" />
</xsd:complexType>

The other set of elements looks like this:

<xsd:element name="Employees" minOccurs="0" maxOccurs="1">
<xsd:complexType>
  <xsd:sequence>
    <xsd:element name="ROW">
      <xsd:complexType>
        <xsd:sequence>
          <xsd:element name="ID" type="xdv:guidKey" nillable="false" />
          <xsd:element name="Seq" type="xdv:guidKey" nillable="false" />
          <xsd:element name="CompanyName" minOccurs="0">
            <xsd:complexType>
              <xsd:simpleContent>
                <xsd:extension base="xdv:stringLen32">
                  <xsd:attribute name="origVal" type="xdv:stringLen32" use="optional" />
                </xsd:extension>
              </xsd:simpleContent>
            </xsd:complexType>
          </xsd:element>
          ... more stuff...
    </xsd:element>
  </xsd:sequence>
  <xsd:attribute name="name" type="xsd:string" use="required" fixed="Employees" />
  <xsd:attribute name="alias" type="xsd:string" use="required" fixed="Employees" />
  <xsd:attribute name="keys" type="xsd:string" use="required" fixed="OpportunityID,Seq" />
  <xsd:attribute name="codeTableColVal" type="xdv:codeTableColVal" use="optional" />
</xsd:complexType>

The primary difference being that the former specifies minOccurs=”0″ for Prospects and no max occurs, then for ROW it defins minOccurs=0 and maxOccurs=unbounded.

For the latter it defines minOccurs=0 and maxOccurs=1 for Employees and for the ROW it does not define a minOccurs or maxOccurs.

When I run the utility program, Xsd2Code, and it generates my C# code, for the Prospects, it creates a Prospects property with a ROWs collection (As a List()) but for the Employees it create an Employee property with a ROW property, not a collection.

My question: whats is the schema rule for this? Since there is no
maxOccurs defined on ROW for employee does the min and max for the
parent apply or should it be a collection?

I am trying to determine if the utility that is creating my code is wrong or if the .xsd file is wrong.

  • 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-27T13:35:33+00:00Added an answer on May 27, 2026 at 1:35 pm

    The default if maxOccurs is not specified is the same as maxOccurs = "1".

    From XML Schema Indicators.

    Occurrence indicators are used to define how often an element can
    occur.

    Note: For all “Order” and “Group” indicators (any, all, choice,
    sequence, group name, and group reference) the default value for
    maxOccurs and minOccurs is 1.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a gigantic QuickBooks SDK .XSD schema file which defines XML requests/responses that
I have a schema that defines default values for elements and attributes. I am
I have several elements defined in my XSD file that I use as references
I have a an XSD that looks like this (roughly) <xs:schema id=Appointment targetNamespace=http://tempuri.org/Record.xsd elementFormDefault=qualified
I have one xsd file I'd rather not modify (Exceptions.xsd): <xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema xmlns=http://me.com/Exceptions.xsd targetNamespace=http://me.com/Exceptions.xsd
I have an XML Schema Definition file .XSD who's elements are in Spanish. I
I have XSD Schema with the following structure: ElementA has only one ElementB and
I have defined schema for xml in file packetTemplate.xsd.Using ms tool xsd.exe i have
I have an attributeGroup defined in my XSD schema. From what I've read and
I have an XSD schema with target namespace ns1 which defines the following type:

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.