File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

xschoice vs xs:enumeration

 
kri shan
Ranch Hand
Posts: 1453
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<xs:choice> and xs:enumeration looks same. How xs:enumeartion fdiffer from xs:cohice ?
 
kri shan
Ranch Hand
Posts: 1453
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bartender, Please move this thread to
XML and related Technologies
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
The <choice> element allows one of the elements contained in the <choice> element to be present in the containing element. Note that if you set maxOccurs to, for instance, 2 then you are allowed to choose two of elements inside the <choice> element.
Enumeration is a facet that you can use when defining a simple type. The enumeration facet allows you to provide a list of allowed values for the type in question.
If you want examples, please let me know!
Best wishes!
 
kri shan
Ranch Hand
Posts: 1453
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ivan, can you give examples for allowing two elements inside the <choice> element ?
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
The following XML schema allows one person to own at most two computers and requires the person to own at least one computer:


The following XML fragment is valid according to the above schema:

We can see that Ivan owns a MacBook, which is a notebook, and a Zuug 2000, which is a desktop computer - all in all two computers.
Best wishes!
 
kri shan
Ranch Hand
Posts: 1453
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ivan, If i do not give minOccurs and maxOccurs in this line How choice will behave ?
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I answer your question with a question:
What are the default values for minOccurs and maxOccurs?
Best wishes!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic