[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
XSD Question: what is the current recommendation regarding largevalues for maxOccurs?
- From: "Costello, Roger L." <costello@mitre.org>
- To: "xml-dev@lists.xml.org" <xml-dev@lists.xml.org>
- Date: Tue, 9 Aug 2011 08:17:49 -0400
Hi Folks,
This is a question about XML Schema. Specifically, about the maxOccurs attribute.
Recall that the maxOccurs attribute is used to specify the maximum number of occurrences of an element. For example, the following says that there may be up to 10 Authors:
<element name="Author" type="..." maxOccurs="10" />
Suppose that my business requirements are that there must not be more than 500 Foo elements. I could declare Foo as such:
<element name="Foo" type="..." maxOccurs="500" />
I recall years ago the recommendation was to avoid setting maxOccurs to a large number because at that time XML Schema validators would allocate memory for all the potential occurrences. For example, a validator would allocate 500 units of memory for the Foo element.
The recommendation at that time was this: if you need a large number of occurrences, set maxOccurs to unbounded.
Is that still the recommendation? Or, are validators more sophisticated now and can handle large values for maxOccurs?
/Roger
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]