Author: atsushi
Date: 2008-02-18 23:02:53 -0500 (Mon, 18 Feb 2008)
New Revision: 96115

Added:
   trunk/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSchemasTests.cs
Modified:
   trunk/mcs/class/System.XML/ChangeLog
   trunk/mcs/class/System.XML/Mono.Xml.Schema/ChangeLog
   trunk/mcs/class/System.XML/Mono.Xml.Schema/XsdWildcard.cs
   trunk/mcs/class/System.XML/System.Xml.Schema/ChangeLog
   trunk/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAny.cs
   trunk/mcs/class/System.XML/System.Xml_test.dll.sources
   trunk/mcs/class/System.XML/Test/System.Xml.Serialization/ChangeLog
Log:
2008-02-19  Atsushi Enomoto <[EMAIL PROTECTED]>

        * XsdWildcard.cs : block extra compilation and made compilation reset.
          This somehow fixed bug #360541.

        * XmlSchemaAny.cs : block extra compilation in anyTypeContent.

        * XmlSchemasTests.cs : new test file (for bug #360541).

        * System.Xml_test.dll.sources: added XmlSchemasTests.cs.



Modified: trunk/mcs/class/System.XML/ChangeLog
===================================================================
--- trunk/mcs/class/System.XML/ChangeLog        2008-02-19 00:16:15 UTC (rev 
96114)
+++ trunk/mcs/class/System.XML/ChangeLog        2008-02-19 04:02:53 UTC (rev 
96115)
@@ -1,3 +1,7 @@
+2008-02-19  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
+       * System.Xml_test.dll.sources: added XmlSchemasTests.cs.
+
 2008-02-04  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
        * System.Xml_test.dll.sources : added XmlSchemaValidatorTests.cs.

Modified: trunk/mcs/class/System.XML/Mono.Xml.Schema/ChangeLog
===================================================================
--- trunk/mcs/class/System.XML/Mono.Xml.Schema/ChangeLog        2008-02-19 
00:16:15 UTC (rev 96114)
+++ trunk/mcs/class/System.XML/Mono.Xml.Schema/ChangeLog        2008-02-19 
04:02:53 UTC (rev 96115)
@@ -1,3 +1,8 @@
+2008-02-19  Atsushi Enomoto <[EMAIL PROTECTED]>
+
+       * XsdWildcard.cs : block extra compilation and made compilation reset.
+         This somehow fixed bug #360541.
+
 2007-10-31  Atsushi Enomoto <[EMAIL PROTECTED]>
 
        * XsdValidatingReader.cs : r68046 didn't really fix the issue.

Modified: trunk/mcs/class/System.XML/Mono.Xml.Schema/XsdWildcard.cs
===================================================================
--- trunk/mcs/class/System.XML/Mono.Xml.Schema/XsdWildcard.cs   2008-02-19 
00:16:15 UTC (rev 96114)
+++ trunk/mcs/class/System.XML/Mono.Xml.Schema/XsdWildcard.cs   2008-02-19 
04:02:53 UTC (rev 96115)
@@ -49,19 +49,32 @@
 
                public XmlSchemaContentProcessing ResolvedProcessing;
                public string TargetNamespace;
+               public bool SkipCompile;
                public bool HasValueAny;
                public bool HasValueLocal;
                public bool HasValueOther;
                public bool HasValueTargetNamespace;
                public StringCollection ResolvedNamespaces;
 
+               void Reset ()
+               {
+                       HasValueAny = false;
+                       HasValueLocal = false;
+                       HasValueOther = false;
+                       HasValueTargetNamespace = false;
+                       ResolvedNamespaces = new StringCollection ();
+               }
+
                public void Compile (string nss,
                        ValidationEventHandler h, XmlSchema schema)
                {
+                       if (SkipCompile)
+                               return; // used by XmlSchemaAny.AnyTypeContent.
+
+                       Reset ();
                        int nscount = 0;
                        string actualNamespace = nss == null ? "##any" : nss;
                        string[] nslist = 
XmlSchemaUtil.SplitList(actualNamespace);
-                       ResolvedNamespaces = new StringCollection ();
                        for (int i = 0; i < nslist.Length; i++) {
                                string ns = nslist [i];
                                switch(ns) {

Modified: trunk/mcs/class/System.XML/System.Xml.Schema/ChangeLog
===================================================================
--- trunk/mcs/class/System.XML/System.Xml.Schema/ChangeLog      2008-02-19 
00:16:15 UTC (rev 96114)
+++ trunk/mcs/class/System.XML/System.Xml.Schema/ChangeLog      2008-02-19 
04:02:53 UTC (rev 96115)
@@ -1,3 +1,7 @@
+2008-02-19  Atsushi Enomoto <[EMAIL PROTECTED]>
+
+       * XmlSchemaAny.cs : block extra compilation in anyTypeContent.
+
 2008-02-04  Atsushi Enomoto <[EMAIL PROTECTED]>
 
        * XmlSchemaValidator.cs : added couple of null argument check.

Modified: trunk/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAny.cs
===================================================================
--- trunk/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAny.cs        
2008-02-19 00:16:15 UTC (rev 96114)
+++ trunk/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAny.cs        
2008-02-19 04:02:53 UTC (rev 96115)
@@ -52,9 +52,10 @@
                                        anyTypeContent.Namespace = "##any";
                                        anyTypeContent.wildcard.HasValueAny = 
true;
                                        
anyTypeContent.wildcard.ResolvedNamespaces = new StringCollection ();
-                                       // Although it is not documented by 
W3C, but it should be.
+                                       // It is not documented by W3C but it 
should be.
                                        
anyTypeContent.wildcard.ResolvedProcessing =
-                                       anyTypeContent.ProcessContents = 
XmlSchemaContentProcessing.Lax;
+                                               anyTypeContent.ProcessContents 
= XmlSchemaContentProcessing.Lax;
+                                       anyTypeContent.wildcard.SkipCompile = 
true;
                                }
                                return anyTypeContent;
                        }

Modified: trunk/mcs/class/System.XML/System.Xml_test.dll.sources
===================================================================
--- trunk/mcs/class/System.XML/System.Xml_test.dll.sources      2008-02-19 
00:16:15 UTC (rev 96114)
+++ trunk/mcs/class/System.XML/System.Xml_test.dll.sources      2008-02-19 
04:02:53 UTC (rev 96115)
@@ -82,6 +82,7 @@
 System.Xml.Serialization/XmlRootAttributeTests.cs
 System.Xml.Serialization/XmlSchemaExporterTests.cs
 System.Xml.Serialization/XmlSchemaImporterTests.cs
+System.Xml.Serialization/XmlSchemasTests.cs
 System.Xml.Serialization/XmlSerializationReaderTests.cs
 System.Xml.Serialization/XmlSerializationWriterTests.cs
 System.Xml.Serialization/XmlTextAttributeTests.cs

Modified: trunk/mcs/class/System.XML/Test/System.Xml.Serialization/ChangeLog
===================================================================
--- trunk/mcs/class/System.XML/Test/System.Xml.Serialization/ChangeLog  
2008-02-19 00:16:15 UTC (rev 96114)
+++ trunk/mcs/class/System.XML/Test/System.Xml.Serialization/ChangeLog  
2008-02-19 04:02:53 UTC (rev 96115)
@@ -1,3 +1,7 @@
+2008-02-19  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
+       * XmlSchemasTests.cs : new test file (for bug #360541).
+
 2007-11-02  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
        * XmlSerializerTests.cs : added test for bug #338705.

Added: 
trunk/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSchemasTests.cs
===================================================================
--- trunk/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSchemasTests.cs 
2008-02-19 00:16:15 UTC (rev 96114)
+++ trunk/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSchemasTests.cs 
2008-02-19 04:02:53 UTC (rev 96115)
@@ -0,0 +1,85 @@
+//
+// XmlSchemasTests.cs
+//
+// Author:
+//     Atsushi Enomoto  <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2008 Novell, Inc.
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Xml;
+using System.Xml.Schema;
+using System.Xml.Serialization;
+
+using NUnit.Framework;
+
+using MonoTests.System.Xml.TestClasses;
+
+namespace MonoTests.System.XmlSerialization
+{
+       [TestFixture]
+       public class XmlSchemasTests
+       {
+               [Test]
+               public void Bug360541 ()
+               {
+                       XmlSchemaComplexType stype = GetStype ();
+                       
+                       XmlSchemaElement selem1 = new XmlSchemaElement ();
+                       selem1.Name = "schema";
+                       selem1.SchemaType = stype;
+
+                       XmlSchema schema = new XmlSchema ();
+                       schema.Items.Add (selem1);
+
+                       XmlSchemas xs = new XmlSchemas ();
+                       xs.Add (schema);
+
+                       xs.Find (XmlQualifiedName.Empty, typeof 
(XmlSchemaElement));
+
+                       selem1 = new XmlSchemaElement ();
+                       selem1.Name = "schema1";
+                       selem1.SchemaType = stype;
+
+                       schema = new XmlSchema ();
+                       schema.Items.Add (selem1);
+
+                       xs = new XmlSchemas ();
+                       xs.Add (schema);
+                       xs.Find (XmlQualifiedName.Empty, typeof 
(XmlSchemaElement));
+               }
+
+               XmlSchemaComplexType GetStype ()
+               {
+                       XmlSchemaSequence seq = new XmlSchemaSequence ();
+                       seq.Items.Add (new XmlSchemaAny ());
+               
+                       XmlSchemaComplexType stype = new XmlSchemaComplexType 
();
+                       stype.Particle = seq;
+                       
+                       return stype;
+               }
+       }
+}


Property changes on: 
trunk/mcs/class/System.XML/Test/System.Xml.Serialization/XmlSchemasTests.cs
___________________________________________________________________
Name: svn:eol-style
   + native

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to