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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:01:00+00:00 2026-06-12T22:01:00+00:00

I have a xml file that looks like this: <Summary> <Persons> <Status> <Active value=false

  • 0

I have a xml file that looks like this:

<Summary>
  <Persons>
    <Status>
      <Active value="false" text="Active" />
      <Inactive value="false" text="Inactive" />
    </Status>
   <Language>
      <Dutch value="false" text="" />
      <EnglishUK value="false" text="" />
      <EnglishUS value="false" text="" />
      <German value="false" text="" />
      <French value="false" text="" />
  </Language>
 </Persons>
 <Roles>
  <Status>
   <Active value="false" text="" />
   <Inactive value="false" text="" />
  </Status>
  <AssignedUsers>
   <m10 value="false" text="" />
   <b10and50 value="false" text="" />
   <x50 value="false" text="" />
  </AssignedUsers>
 </Roles>
</Summary>

i created a xsd from this xml using a online xsd generator:

<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified"
  xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Summary">
<xs:complexType>
  <xs:sequence>
    <xs:element name="Persons">
      <xs:complexType>
        <xs:sequence>
          <xs:element name="Status">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="Active">
                  <xs:complexType>
                    <xs:simpleContent>
                      <xs:extension base="xs:string">
                        <xs:attribute type="xs:string" name="value"/>
                        <xs:attribute type="xs:string" name="text"/>
                      </xs:extension>
                    </xs:simpleContent>
                  </xs:complexType>
                </xs:element>
                <xs:element name="Inactive">
                  <xs:complexType>
                    <xs:simpleContent>
                      <xs:extension base="xs:string">
                        <xs:attribute type="xs:string" name="value"/>
                        <xs:attribute type="xs:string" name="text"/>
                      </xs:extension>
                    </xs:simpleContent>
                  </xs:complexType>
                </xs:element>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
          <xs:element name="Anonymous">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="Yes">
                  <xs:complexType>
                    <xs:simpleContent>
                      <xs:extension base="xs:string">
                        <xs:attribute type="xs:string" name="value"/>
                        <xs:attribute type="xs:string" name="text"/>
                      </xs:extension>
                    </xs:simpleContent>
                  </xs:complexType>
                </xs:element>
                <xs:element name="No">
                  <xs:complexType>
                    <xs:simpleContent>
                      <xs:extension base="xs:string">
                        <xs:attribute type="xs:string" name="value"/>
                        <xs:attribute type="xs:string" name="text"/>
                      </xs:extension>
                    </xs:simpleContent>
                  </xs:complexType>
                </xs:element>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
          <xs:element name="Language">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="Dutch">
                  <xs:complexType>
                    <xs:simpleContent>
                      <xs:extension base="xs:string">
                        <xs:attribute type="xs:string" name="value"/>
                        <xs:attribute type="xs:string" name="text"/>
                      </xs:extension>
                    </xs:simpleContent>
                  </xs:complexType>
                </xs:element>
                <xs:element name="EnglishUK">
                  <xs:complexType>
                    <xs:simpleContent>
                      <xs:extension base="xs:string">
                        <xs:attribute type="xs:string" name="value"/>
                        <xs:attribute type="xs:string" name="text"/>
                      </xs:extension>
                    </xs:simpleContent>
                  </xs:complexType>
                </xs:element>
                <xs:element name="EnglishUS">
                  <xs:complexType>
                    <xs:simpleContent>
                      <xs:extension base="xs:string">
                        <xs:attribute type="xs:string" name="value"/>
                        <xs:attribute type="xs:string" name="text"/>
                      </xs:extension>
                    </xs:simpleContent>
                  </xs:complexType>
                </xs:element>
                <xs:element name="German">
                  <xs:complexType>
                    <xs:simpleContent>
                      <xs:extension base="xs:string">
                        <xs:attribute type="xs:string" name="value"/>
                        <xs:attribute type="xs:string" name="text"/>
                      </xs:extension>
                    </xs:simpleContent>
                  </xs:complexType>
                </xs:element>
                <xs:element name="French">
                  <xs:complexType>
                    <xs:simpleContent>
                      <xs:extension base="xs:string">
                        <xs:attribute type="xs:string" name="value"/>
                        <xs:attribute type="xs:string" name="text"/>
                      </xs:extension>
                    </xs:simpleContent>
                  </xs:complexType>
                </xs:element>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
        </xs:sequence>
      </xs:complexType>
    </xs:element>
    <xs:element name="Roles">
      <xs:complexType>
        <xs:sequence>
          <xs:element name="Status">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="Active">
                  <xs:complexType>
                    <xs:simpleContent>
                      <xs:extension base="xs:string">
                        <xs:attribute type="xs:string" name="value"/>
                        <xs:attribute type="xs:string" name="text"/>
                      </xs:extension>
                    </xs:simpleContent>
                  </xs:complexType>
                </xs:element>
                <xs:element name="Inactive">
                  <xs:complexType>
                    <xs:simpleContent>
                      <xs:extension base="xs:string">
                        <xs:attribute type="xs:string" name="value"/>
                        <xs:attribute type="xs:string" name="text"/>
                      </xs:extension>
                    </xs:simpleContent>
                  </xs:complexType>
                </xs:element>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
          <xs:element name="AssignedUsers">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="m10">
                  <xs:complexType>
                    <xs:simpleContent>
                      <xs:extension base="xs:string">
                        <xs:attribute type="xs:string" name="value"/>
                        <xs:attribute type="xs:string" name="text"/>
                      </xs:extension>
                    </xs:simpleContent>
                  </xs:complexType>
                </xs:element>
                <xs:element name="b10and50">
                  <xs:complexType>
                    <xs:simpleContent>
                      <xs:extension base="xs:string">
                        <xs:attribute type="xs:string" name="value"/>
                        <xs:attribute type="xs:string" name="text"/>
                      </xs:extension>
                    </xs:simpleContent>
                  </xs:complexType>
                </xs:element>
                <xs:element name="x50">
                  <xs:complexType>
                    <xs:simpleContent>
                      <xs:extension base="xs:string">
                        <xs:attribute type="xs:string" name="value"/>
                        <xs:attribute type="xs:string" name="text"/>
                      </xs:extension>
                    </xs:simpleContent>
                  </xs:complexType>
                </xs:element>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
        </xs:sequence>
      </xs:complexType>
    </xs:element>
  </xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

The problem is that each time i insert a new element into the Persons/Status or for example into the Roles/AssignedUsers, my validation failes.
What i want is a schema to validate the parent elements, like Person/Status and Roles/Status and the rest, but the child elements like ” don’t need to be present, but if they are present, they must have the attributes ‘value’ and ‘text’.
How to create such a schema, some help will be great.

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-06-12T22:01:02+00:00Added an answer on June 12, 2026 at 10:01 pm

    Your validation fails because you have not specified any of the elements as optional so, all of them become mandatory. Try adding minOccurs="0" to the elements that are optional.

    For eg. I changed

    <xs:element name="Anonymous" minOccurs="0">
    

    and your sample xml was validated without errors

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

Sidebar

Related Questions

I have an XML file that looks like this: <SiteMenuItems> <SiteMenuItem text=Home navigateurl=/Default.aspx tooltip=Return
I have an XML file that looks like this... <foo> <bar>$VALUE$</bar> </foo> Is there
I have an xml file that looks something like this <questions> <question> <text>What color
I have an xml file that looks like this: <args> <sometag value=abc /> <anothertag
I have an XML file that looks like this <comments> <text> <![CDATA[ <!--cached-Tue, 02
I have a large xml file that looks like this: 20120124 07:30:15.301, saving to
--edited for clarity (hopefully) I have an XML file that looks something like this:
I have an eclipse's .classpath file that looks like this: <?xml version=1.0 encoding=UTF-8?> <classpath>
I have an XML file that reads like this <abc> <ab>value</ab> <aa>time</aa> <ac>money</ac> </abc>
I have an XML file that looks like this. <collections id=my collections> <category id=my

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.