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

The Archive Base Latest Questions

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

Tell me please, how can I create xsd schema, which successfully validate the following

  • 0

Tell me please, how can I create xsd schema, which successfully validate the following xml:
—> XML 1

    <?xml version="1.0" encoding="UTF-8"?>
<start xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="schema.xsd">
  <list>
    <typeA>
      <value>test string value 123</value>
    </typeA>
    <typeB>
      <value>test string value 456</value>
    </typeB>
    <typeC>
      <value>test string value 789</value>
    </typeC>
  </list>
</start>

—> XML 2

    <?xml version="1.0" encoding="UTF-8"?>
<start xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="schema.xsd">
  <list>
    <typeB>
      <value>test string value 456</value>
    </typeB>
    <typeC>
      <value>test string value 789</value>
    </typeC>
  </list>
</start>

—> XML 3

    <?xml version="1.0" encoding="UTF-8"?>
<start xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="schema.xsd">
  <list>
    <typeC>
      <value>test string value 789</value>
    </typeC>
    <typeC>
      <value>test string value 123</value>
    </typeC>
  </list>
</start>

—> XML 4

    <?xml version="1.0" encoding="UTF-8"?>
<start xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="schema.xsd">
  <list>
    <typeC>
      <value>test string value 789</value>
    </typeC>
  </list>
</start>

I write XSD, but it doesn’t work:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="typeC">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="value" type="xs:string"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="typeB">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="value" type="xs:string"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="typeA">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="value" type="xs:string"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="start">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="list"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="list">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="typeA"/>
                <xs:element ref="typeB"/>
                <xs:element ref="typeC"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

Is there any other way to achieve this?

Thanks in advance!

  • 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-31T12:56:54+00:00Added an answer on May 31, 2026 at 12:56 pm

    The way you have defined the inclusion of your elements typeA, typeB, and typeC is set such that one and exactly one of each must be included. It sounds like you want it to be more flexible so that 0 or many of each element can be included. Look at the maxOccurrs and minOccurs attributes.

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

Sidebar

Related Questions

Can someone please help me, I have this xml snippet <?xml version=1.0 encoding=utf-8 ?>
Can someone please tell me how I can implement the following line of pseudo-code.
Could someone tell me please how I can create a custom converter I know
Can you please tell me how can I create an android menu item using
Can you please tell me how can I create my own Preference class in
HI, Can you please tell me how can I create 3 equally wide TextView
please tell me that can we create an array of imteger in objective c
Can anyone please tell me if it is possible to create an SSRS 2008
I have to create webapplication like igoogle.So how can i create widgets? Please tell
Can anyone please tell me the XML structure for sub-items that jqgrid uses. I've

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.