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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:21:32+00:00 2026-05-14T07:21:32+00:00

I have an XSD which was transformed from a RELAX NG schema with a

  • 0

I have an XSD which was transformed from a RELAX NG schema with a few errors I am trying to fix. The big issue I have it with the following

  <xs:element name="list">
    <xs:complexType>
      <xs:sequence>
        <xs:choice>
          <xs:sequence>
            <xs:element minOccurs="0" ref="preamble"/>
            <xs:element minOccurs="0" ref="title"/>
          </xs:sequence>
          <xs:sequence>
            <xs:element minOccurs="0" ref="title"/>
            <xs:element minOccurs="0" ref="preamble"/>
          </xs:sequence>
        </xs:choice>
        <xs:group maxOccurs="unbounded" ref="block-selectionListItem"/>
      </xs:sequence>
      <xs:attributeGroup ref="attlist-selectionList"/>
    </xs:complexType>
  </xs:element>

As you can see the xs:choice block allows you to pick between two xs:sequence blocks. Seems to make sense except that Visual Studio gives the following warning on the second <xs:element minOccurs="0" ref="title/> element which is throwing everything off:

Multiple definition of element ‘title’ causes the content model to become ambiguous. A content model must be formed such that during validation of an element information item sequence, the particle contained directly, indirectly or implicitly therein with which to attempt to validate each item in the sequence in turn can be uniquely determined without examining the content or attributes of that item, and without any information about the items in the remainder of the sequence.

Because you can only choose one I do not see how this is ambiguous. Any help would be greatly appreciated!

Answer:

As was pointed out in the answer below I was not accounting for all possibilities. So here is what I had to do:

  <xs:element name="list">
    <xs:complexType>
      <xs:sequence>
        <xs:group minOccurs ="0" maxOccurs="1" ref ="list-titlePreambleChoice"/>
        <xs:group maxOccurs="unbounded" ref="block-basicListItem"/>
      </xs:sequence>
      <xs:attributeGroup ref="attlist-basicList"/>
    </xs:complexType>
  </xs:element>

This solved all my issues. Thanks!

  • 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-14T07:21:33+00:00Added an answer on May 14, 2026 at 7:21 am

    It’s ambiguous because of the minOccurs="0". If the validator finds a preamble element, is it the first element of the first choice, or is it the second element of the second choice and the title element is missing?

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

Sidebar

Related Questions

I have an XSD schema with target namespace ns1 which defines the following type:
I have xsd schema file which I can't change. Here is an excerpt that
In my source tree have Java code which is automatically generated from XSD files.
I have an XSD (XML Schema) which contains multiple files. There's a catalog.xml in
In XSD i have one element x which takes values (a,b) There is another
I have an XSD file which contains the schema for my XML. The XSD
I have a gigantic QuickBooks SDK .XSD schema file which defines XML requests/responses that
I have an xsd file from which I am generating a C# class. In
JAXB generated from XSD base64Binary and hexBinary to byte array. I have xsd element
I have a XSD file, from which I want to generate C# and Java

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.