• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

xschoice vs xs:enumeration

 
Ranch Hand
Posts: 1491
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<xs:choice> and xs:enumeration looks same. How xs:enumeartion fdiffer from xs:cohice ?
 
kri shan
Ranch Hand
Posts: 1491
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Bartender, Please move this thread to

XML and related Technologies

 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 1491
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 1491
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
I answer your question with a question:
What are the default values for minOccurs and maxOccurs?
Best wishes!
reply
    Bookmark Topic Watch Topic
  • New Topic