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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:35:18+00:00 2026-05-27T13:35:18+00:00

I try to create an XML to describe exercises with multiple choice options or

  • 0

I try to create an XML to describe exercises with multiple choice options or just plain text. The XML could look like this:

<exercise number="1" type="multiChoice">
<question>My very importand question</question>
<answer type="false">yes</answer>
<answer type="true">no</answer>

<exercise number="2" type="text">
    <question>Question 2</question>
    <answer>the right answer</answer>
</exercise>

So I tried to use a sequence for the answer, which didnt work if I try to validate it when I’m having more than one of the <answer>-Tags in the XML.

This is the Schema:

    <xs:complexType name="exerciseType">
    <xs:sequence>
        <xs:element name="question" type="questionType"/>
        <xs:sequence>
            <xs:element name="answer" minOccurs="1">
                <xs:complexType>
                    <xs:simpleContent>
                        <xs:extension base="xs:string">
                            <xs:attribute name="type" type="xs:boolean" use="optional"/>
                        </xs:extension>
                    </xs:simpleContent>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:sequence>
    <xs:attribute name="number" type="xs:positiveInteger"/>
    <xs:attribute name="type" type="xs:string"/>
</xs:complexType>

Anyone knows what is wrong with my schema?

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-27T13:35:19+00:00Added an answer on May 27, 2026 at 1:35 pm

    You could try to set maxOccurs attribute:

    <xs:complexType name="exerciseType">
        <xs:sequence>
            <xs:element name="question" type="questionType"/>
            <xs:element name="answer" maxOccurs="unbounded">
        </xs:sequence>
        <xs:attribute name="number" type="xs:positiveInteger"/>
        <xs:attribute name="type" type="xs:string"/>
    </xs:complexType>
    

    Disclaimer: this was written without being validated by a tool and can contain bugs.

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

Sidebar

Related Questions

How create XML from XML using XSL ? I try like this.. but i
I'm using android 3.0 and I try to create bitmap xml that will create
I'm writing out an XML file using VB.net. When I try to create another
I am trying to create a dynamically generated XML file from Java. This is
How to create xml document with node prefix like: <sphinx:docset> <sphinx:schema> <sphinx:field name=subject/> <sphinx:field
I try to dynamically create an XML schema (XSD) from C#, using the conventional
I have the code below to create a XML file <?php try { $dom
I try to create a AutoCompleteTextView with custom list items, like showing a picture
In my android app I try to create a xml file on sdcard. I
I try to create a new file inside a JSP and try to save

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.