diff options
author | Atsushi Eno <atsushieno@gmail.com> | 2008-04-03 00:01:31 +0400 |
---|---|---|
committer | Atsushi Eno <atsushieno@gmail.com> | 2008-04-03 00:01:31 +0400 |
commit | 82d014295d9500ed7450141410724b04b54502ee (patch) | |
tree | aae70d5a628a965b826e15a22c04bb7820934770 /mcs/class/System.XML/Mono.Xml.Schema | |
parent | 25822901ede2a5519fe20602daba0163279a6092 (diff) |
2008-04-02 Atsushi Enomoto <atsushi@ximian.com>
* XsdParticleValidationState.cs : a choice with only empty particle
children is emptiable. Fixed bug #376395.
* XsdValidatingReaderTests.cs : added test for bug #376395.
* 376395.xml, 376395.xsd : new test files.
* Makefile : extra distfiles (376395.xml, 376395.xsd).
svn path=/trunk/mcs/; revision=99679
Diffstat (limited to 'mcs/class/System.XML/Mono.Xml.Schema')
-rw-r--r-- | mcs/class/System.XML/Mono.Xml.Schema/ChangeLog | 5 | ||||
-rw-r--r-- | mcs/class/System.XML/Mono.Xml.Schema/XsdParticleValidationState.cs | 12 |
2 files changed, 15 insertions, 2 deletions
diff --git a/mcs/class/System.XML/Mono.Xml.Schema/ChangeLog b/mcs/class/System.XML/Mono.Xml.Schema/ChangeLog index 331a22d42dc..5808a35bb5d 100644 --- a/mcs/class/System.XML/Mono.Xml.Schema/ChangeLog +++ b/mcs/class/System.XML/Mono.Xml.Schema/ChangeLog @@ -1,3 +1,8 @@ +2008-04-02 Atsushi Enomoto <atsushi@ximian.com> + + * XsdParticleValidationState.cs : a choice with only empty particle + children is emptiable. Fixed bug #376395. + 2008-02-19 Atsushi Enomoto <atsushi@ximian.com> * XsdWildcard.cs : block extra compilation and made compilation reset. diff --git a/mcs/class/System.XML/Mono.Xml.Schema/XsdParticleValidationState.cs b/mcs/class/System.XML/Mono.Xml.Schema/XsdParticleValidationState.cs index ef7fb08e4c6..1d541406c3a 100644 --- a/mcs/class/System.XML/Mono.Xml.Schema/XsdParticleValidationState.cs +++ b/mcs/class/System.XML/Mono.Xml.Schema/XsdParticleValidationState.cs @@ -463,6 +463,7 @@ namespace Mono.Xml.Schema public override XsdValidationState EvaluateStartElement (string localName, string ns) { emptiableComputed = false; + bool allChildrenEmptiable = true; for (int i = 0; i < choice.CompiledItems.Count; i++) { XmlSchemaParticle xsobj = (XmlSchemaParticle) choice.CompiledItems [i]; @@ -477,9 +478,16 @@ namespace Mono.Xml.Schema else return Manager.MakeSequence (result, this); } + if (!emptiableComputed) + allChildrenEmptiable &= xa.EvaluateIsEmptiable (); + } + if (!emptiableComputed) { + if (allChildrenEmptiable) + emptiable = true; + if (!emptiable) + emptiable = choice.ValidatedMinOccurs <= Occured; + emptiableComputed = true; } - emptiable = choice.ValidatedMinOccurs <= Occured; - emptiableComputed = true; return XsdValidationState.Invalid; } |