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


Help: OASIS Mailing Lists Help | MarkMail Help



   RE: [xml-dev] Constrain the Number of Occurrences of Elements in your XM

[ Lists Home | Date Index | Thread Index ]

I agree that recursion can be extremely useful.  In fact, recursion is fun!
However, "runaway recursion" is not useful, nor is it fun.
The recursive capability in XML Schemas does not (as Len noted) allow you to specify a maximum depth of recursion.  Thus, it is runaway recursion.  Consequently, I contend that it's best to completely abstain from the recursion that is provided by XML Schemas.

From: Bullard, Claude L (Len) [mailto:len.bullard@intergraph.com]
Sent: Friday, August 05, 2005 2:24 PM
To: 'Doug Rudder'; 'Roger L. Costello'; 'XML Developers List'
Subject: RE: [xml-dev] Constrain the Number of Occurrences of Elements in your XML Schema

I agree with Doug.  Unless there is clear evidence that a feature is creating a problem or
will soon, don't close an extensibility feature.   Wildcards, xsd:any, this sort of construct,
are the real heart of the 'extensibility' of XML.  Otherwise, schemas are just a means to
validate.   Even if there is overlap, it sometimes dicey to turn a validator into a filter. 
Sometimes one has to limit the depth of a recursion and when we had the SGML Declaration,
that could be specified (support varied but the intent was clear).   Otherwise, I don't think
I'd go so far as to say 'never use it' because it, like mixed content, proves to be an organic
property of the data.  I don't like to constrain organic properties to suit the tool.
That usually bites.   To put it another way, in a domain of attractors, you can rely on 
strict rules on the limit and fixed types, but the strange ones remain strange.
Keep a light hand on the tiller.
-----Original Message-----
From: Doug Rudder [mailto:drudder@drugfacts.com]
Sent: Friday, August 05, 2005 1:12 PM
To: 'Roger L. Costello'; 'XML Developers List'
Subject: RE: [xml-dev] Constrain the Number of Occurrences of Elements in your XML Schema

Personal opinion: Recursive structures can be among the most valuable structures available in XML, especially with regard to generic <section> (and similar) elements. Putting a cap on maxOccurs and adjusting as needed going forward can be a good idea.
Frankly, nothing in your arguments below justify the statement "don't use recursive constructions." You do make a good argument for restricting maxOccurs. An awful lot of the discussion is related to specific "possible" conditions that can lead to problems. It is very subjective. If recursion is not good for what you do, don't use it. But telling others that they shouldn't when it is an important, proven part of their processes just doesn't float. Quite a few major XML players are proponents of recursive sections, based largely on experience. Of course, quite a few are of the opposite opinion as well. :-)
I've written XML tips illustrating both potential strengths and potential pitfalls of recursive sections, but would need time to rewrite them here (since the online journal I wrote them for owns the copyright to the exact phrasing of the tips). The point is, the value of recursion depends largely on what you are trying to accomplish.


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

Copyright 2001 XML.org. This site is hosted by OASIS