Well, I think that is a pretty fundamental question but consider this XML:
<cars>
<car>
<make>Honda</make>
<model>Accord</model>
<possibleColor>Yellow</possibleColor>
<possibleColor>Green</possibleColor>
<possibleColor>Blue</possibleColor>
<possibleColor>Black</possibleColor>
<possibleColor>White</possibleColor>
<possibleColor>Grey</possibleColor>
</car>
<car>
<make>Dodge</make>
<model>Viper</model>
<possibleColor>Red</possibleColor>
<possibleColor>Green</possibleColor>
<possibleColor>Blue</possibleColor>
<possibleColor>Black</possibleColor>
<turbo>true</turbo>
</car>
</cars>
Now, it certainly doesn't make sense that one particular car would have more
than one model and we need to make sure that each car we talk about tells us
what model it is, so we would need a way to say "Hey, you can only use the
<model> element once and it can't be omitted." That's where the use of
MinOccurs=1 MaxOccurs=1 would come in.
On the other hand, you can order this car in one of several colors but it
must have at least one color that it could be, so we need to be able to have
many <possibleColor> elements. This is where MinOccurs=1 MaxOccurs=6 would
come in.
Now, the Honda Accord is not a turbocharged vehicle, but other a Dodge Viper
"might" be, so in the schema we would have a <tubo> element that is
configured with MinOccurs=0 MaxOccurs=1 to specify that a <turbo> element
"could" exist once but doesn't have to.
Does this make sense?
"rodchar" <ro*****@discussions.microsoft.com> wrote in message
news:48**********************************@microsof t.com...
could you please give me an example or two why you would want to specify
an
element occur only once or any specific number of times.
please forgive me if i'm not seeing the obvious. i'm relatively new to
xml.
"Scott M." wrote:
Because without it, how would you specify that an element should occur
exactly one and only one time?
"rodchar" <ro*****@discussions.microsoft.com> wrote in message
news:71**********************************@microsof t.com... > hey all,
>
> in the overall scheme of the planet earth, why does there have to be a
> MinOccurs property of an element in the dataset designer?
>
> What is this used for in general lamen's terms.
>
> thanks,
> rodchar