OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
XSD Question: what is the current recommendation regarding largevalues for maxOccurs?

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?


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS