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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:56:52+00:00 2026-05-13T15:56:52+00:00

I have an XSD of this form: <?xml version=1.0 encoding=UTF-8?> <schema xmlns=http://www.w3.org/2001/XMLSchema targetNamespace=http://www.example.org/example xmlns:tns=http://www.example.org/example

  • 0

I have an XSD of this form:

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.example.org/example"
    xmlns:tns="http://www.example.org/example" elementFormDefault="qualified">

    <complexType name="bType">
    </complexType>

    <complexType name="aType">
        <choice maxOccurs="unbounded">
            <element name="a" type="tns:aType" />
            <element name="b" type="tns:bType" />
        </choice>
    </complexType>

    <element name="topelement">
        <complexType>
            <sequence>
                <element name="a" type="tns:aType" maxOccurs="1" />
            </sequence>
        </complexType>
    </element>
</schema>

And an XML file that I expect to match it, e.g:

<?xml version="1.0" encoding="UTF-8"?>
<topelement xmlns="http://www.example.org/example"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.example.org/example example.xsd ">
  <a> <!-- Error on this line. -->
    <a/>
    <b/>
    <b/>
    <a/>
  </a>
</topelement>

Unfortunately the XSD says that this is not valid with the following error:

cvc-complex-type.2.4.b: The content of element 'a' is not complete. One of '{"http://www.example.org/example":a, "http://www.example.org/example":b}' is expected.  example.xml line 5

As far as I can tell, I’ve done everything I need to do for the tag to be complete. I’ve filled it with an unbounded choice of ‘a’ and ‘b’ tags. Can anyone see what’s gone wrong?

To clarify, I want there to be only one ‘a’ tag under topelement, and underneath that, a mix of ‘a’ and ‘b’ tags.

  • 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-13T15:56:52+00:00Added an answer on May 13, 2026 at 3:56 pm

    Worked it out… The error is misleading because it’s complaining about the wrong ‘a’.

    Rename the top-level ‘a’ to ‘c’ and it still complains about ‘a’ on line 5.

    The fix is to add minOccurs=0 to the choice element so that not all ‘a’ elements need children.

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

Sidebar

Related Questions

I have this XML <?xml version=1.0 encoding=utf-8?> <root> <xsd:schema id=root xmlns= xmlns:xsd=http://www.w3.org/2001/XMLSchema xmlns:msdata=urn:schemas-microsoft-com:xml-msdata> <xsd:import
I have a an XSD that looks like this (roughly) <xs:schema id=Appointment targetNamespace=http://tempuri.org/Record.xsd elementFormDefault=qualified
Lets assume we have this xml: <?xml version=1.0 encoding=UTF-8?> <tns:RegistryResponse status=urn:oasis:names:tc:ebxml-regrep:ResponseStatusType:Failure xmlns:tns=urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0 xmlns:rim=urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0> <tns:RegistryErrorList
Hi I have xsd schema with base64Binary. when this plugin genereted this elemen looks
I have this in some WSDL: <element name="startDate" type="xsd:dateTime"/> <element name="endDate" type="xsd:dateTime"/> Which results
Does anyone have any tips for dealing with ConstraintExceptions thrown by XSD datasets? This
I have an XSD file that is encoded in UTF-8, and any text editor
I have two XML files with two different XSD schemas and different namespaces. They
Currently I have an Xsd validating with this rule <xs:simpleType name='shipTo'> <xs:restriction base='xs:string'> <xs:minLength
I have a XSD schema for some RESTful service. When used in conjunction with

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.