fix bug #6653: change xs component validation logic regarding recursion check.
commitacdf48cf7127723dc887ba7a3c31990e4548e097
authorAtsushi Eno <atsushieno@veritas-vos-liberabit.com>
Fri, 8 Feb 2013 11:19:14 +0000 (8 20:19 +0900)
committerAtsushi Eno <atsushieno@veritas-vos-liberabit.com>
Fri, 8 Feb 2013 11:19:14 +0000 (8 20:19 +0900)
treea8cf79644783da8975c24a4c612d12bf03c8b10e
parentab381541cffbe4a6e091de7cab9973ee0a5c4a53
fix bug #6653: change xs component validation logic regarding recursion check.

Originally this implementation checked recursion based on RELAX NG-inspired
algorithm explained at http://www.thaiopensource.com/relaxng/simplify.html.

This works only for "simple" syntax, which premises that every <element> is
defined under top-level <define> element. XML Schema doesn't follow this
and could result in infinite loop like reported.

The latest REC-xmlschema-1 denotes the explicit rule on illegal recursion
on 3.8.6 (Model Group Correct) as:

2 Circular groups are disallowed. That is, within the {particles} of a group there must not be at any depth a particle whose {term} is the group itself.

... so, I simply replaced the checker with simple Stack.

(oh, and for old Stack I haven't bothered to replace non-generic collection
everywhere. XSD is as dead as System.Collection.)
mcs/class/System.XML/System.Xml.Schema/XmlSchemaAny.cs
mcs/class/System.XML/System.Xml.Schema/XmlSchemaElement.cs
mcs/class/System.XML/System.Xml.Schema/XmlSchemaGroup.cs
mcs/class/System.XML/System.Xml.Schema/XmlSchemaGroupBase.cs
mcs/class/System.XML/System.Xml.Schema/XmlSchemaGroupRef.cs
mcs/class/System.XML/System.Xml.Schema/XmlSchemaParticle.cs
mcs/class/System.XML/Test/System.Xml.Schema/standalone_tests/Makefile