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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:52:38+00:00 2026-05-24T23:52:38+00:00

I am writing a XSD schema file in Visual Studio 2010. I want to

  • 0

I am writing a XSD schema file in Visual Studio 2010. I want to define a complex type to not be required and have unlimited entires in the xml. I used the minOccurs and maxOccurs attributes but I am getting an error in the editor that these attributes (minOccurs / maxOccurs) are not allowed. I can add them to simple types but not complex types. How do you define that a complex type can have 0 to many occurances?

Here is the xsd I was using:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="patient" minOccurs="0"  maxOccurs="unbounded">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="to" type="xs:string"/>
        <xs:element name="from" type="xs:string"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>
  • 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-24T23:52:39+00:00Added an answer on May 24, 2026 at 11:52 pm

    That should still be valid XSD syntax. Is the VS editor just highlighting it and telling you that it’s not allowed? It may just be reporting incorrectly.

    Edit: Oh, you need a sequence of the complex types!

    <?xml version="1.0" encoding="utf-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:element name="patients">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="patient" minOccurs="0"  maxOccurs="unbounded">
              <xs:complexType>
                <xs:sequence>
                  <xs:element name="to" type="xs:string"/>
                  <xs:element name="from" type="xs:string"/>
                </xs:sequence>
              </xs:complexType>
            </xs:elemennt>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:schema>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing an XSD schema which has an element that describes a file structure:
Visual Studio provides a schema definition for XSLT under C:\Program Files\Microsoft Visual Studio 10.0\Xml\Schemas\xslt.xsd.
I'm writing an XSD for a rather complex XML file format. At many points,
I have an XSD file and I want to create an XML file at
I have been tasked with writing an xsd, for an xml file format that
I am coding on a simple game and writing the *.xsd file. My Problem
I am writing a code generation tool that will take in a XSD file
I'm writing the xsd and the code to validate, so I have great control
I've been tasked with writing a WCF service. (have not done this before.) I've
Suppose I have a XML schema and want to support some extensions at several

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.