• 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

minOccurs Help

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
is minOccurs="0" the same as use="optional" ???
I am confused between the 2?
If so does it mean that minOccurs="1" mean it requires at least one entry?
I would appreciated if somebody can clear this matter up for me.
Thanks in advance.
N.
 
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, neill
You are right. Both "minOccurs" and "use" are occurence constraints. But "minOccurs" (along with "maxOccurs") is used for element definition while "use" for attribute.
The value of the minOccurs attribute is 0 means the element is optional. An element is required to appear when the value of minOccurs is 1 or more. Also value 1 is the default.
Attributes can be declared with a use attribute to indicate whether the attribute is required or optioal or even prohibited (something like DTD). "Optional" is its default value.
Please refer to W3C's Schema Primer for detail. Have fun with XML Schema.

Doug.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic