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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:47:39+00:00 2026-05-23T08:47:39+00:00

I saw an xml schema ( EPP ) whitch used xsd:choice with an element

  • 0

I saw an xml schema ( EPP ) whitch used xsd:choice with an element even if we can use xsd:enumeration instead :

 <element name="access" type="epp:dcpAccessType"/>
    <complexType name="dcpAccessType">
      <choice>
        <element name="all"/>
        <element name="none"/>
        <element name="null"/>
        <element name="other"/>
        <element name="personal"/>
        <element name="personalAndOther"/>
      </choice>
    </complexType>

to make the question clear , I will use this example instead :

<element name="sport" type="sportType"/>

<!-- using choice-->
<complexType name="sportType">
  <choice>
    <element name="football"/>
    <element name="tennis"/>
  </choice>
</complexType>

<!-- Or using enumeration-->
<simpleType name="sportType">
  <restriction base="string">
    <enumeration value="football"/>
    <enumeration value="tennis"/>
  </restriction>
</simpleType>  

an xml example using that schema :

<!--using choice-->
<sport>
  <football/>
</sport>

<!--using enumeration-->
<sport>football</sport>

why they prefer xsd:choice instead of xsd:enumeration in this situation ?

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-23T08:47:39+00:00Added an answer on May 23, 2026 at 8:47 am

    why they prefer xsd:choice instead of xsd:enumeration in this situation ?

    Presumably they want a tag instead of text content in the supported xml.

    The decision to use one or the other is pretty much a matter of xml you want to support, as they do quite different things. Which xml form is preferable is quite subjective.

    See also this related question.

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

Sidebar

Related Questions

xml.etree.ElementTree.parse is choking on my xhtml file. I saw somewhere that lxml can handle
Essentially I want to know if a specific XSD schema can be replaced by
I have this XML file: <Elements> <Element name=A.B.C.x> <Child>...</Child> <Child>...</Child> <Child>...</Child> </Element> <Element name=A.B.C.y>
I have used the XML Parser before, and even though it worked OK, I
While implementing XML file reading/writing in my application I saw that when I call
I saw this excellent post: http://sqldud.blogspot.com/2009/01/how-to-convert-csv-to-xml-using-c.html I have a csv file with the column
I was going to use XML for communicating some data betwwen my server and
I am trying to validate an XML document against an XML Schema . The
I saw the following line in an XML file: xmlns:android=http://schemas.android.com/apk/res/android I have also seen
I saw in this post that I could use the below example to define

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.