Alex Rivera | Logout

XSD maxOccurs="unbounded"

Asked 2009-07-22T14:49:08.320
11

I have generated an XSD file from an XML snippet using xsd.exe /out

What its done is created maxOccurs="unbounded" properties for certain elements.

If I only want the element to appear once, and not be a collection do I set the maxOccurs like this?

maxOccurs="1"

Edit
Report

1 Answer

4

Yes, that's how it's done.

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

Similarly, minOccurs limits the minimum number of repetitions.

They're called occurrence indicators. You can read more about them at W3Schools.

answered 2009-07-22T14:54:10.357

Your Answer