XSD maxOccurs = "unlimited"

I created an XSD file from an XML fragment using xsd.exe /out

What it is made of, the properties maxOccurs="unbounded" for certain elements.

If I want the item to be displayed once, and not be a collection, I set maxOccurs as follows:

MaxOccurs = "1"

+6
xml xsd
source share
3 answers

Yes. Of course, keep in mind that maxOccurs is really the maximum number of events - it can still be zero. If you want to always have one there, you will also need minOccurs = "1".

+15
source share

Yes, how it was done.

maxOccurs limits the maximum number of repetitions of a given element that may appear.

Similarly, minOccurs limits the minimum number of repetitions.

They are called appearance indicators. You can learn more about them at W3Schools .

+3
source share

http://www.w3schools.com/schema/schema_example.asp says that: "The default value for maxOccurs and minOccurs is 1!"

+2
source share

All Articles