System.XML: Partial implementation of XmlSchemaDatatype::ChangeType
[mono.git] / mcs / class / System.XML / System.Xml.Schema / XmlSchemaGroup.cs
index 46c4494f46dfd2b3098b47cfaf6d823c39b65249..ebbfaa2d306fb5f2573b898aa328b4bb400c0b13 100644 (file)
@@ -81,6 +81,13 @@ namespace System.Xml.Schema
                        get { return isCircularDefinition; }
                }
 
+               internal override void SetParent (XmlSchemaObject parent)
+               {
+                       base.SetParent (parent);
+                       if (Particle != null)
+                               Particle.SetParent (this);
+               }
+
                // 1. name must be present
                // 2. MinOccurs & MaxOccurs of the Particle must be absent
                internal override int Compile(ValidationEventHandler h, XmlSchema schema)
@@ -89,17 +96,12 @@ namespace System.Xml.Schema
                        if (CompilationId == schema.CompilationId)
                                return 0;
 
-#if NET_2_0
-                       if (Particle != null)
-                               Particle.Parent = this;
-#endif
-
                        if(Name == null)
                                error(h,"Required attribute name must be present");
                        else if(!XmlSchemaUtil.CheckNCName(this.name)) 
                                error(h,"attribute name must be NCName");
                        else
-                               qualifiedName = new XmlQualifiedName(Name,schema.TargetNamespace);
+                               qualifiedName = new XmlQualifiedName(Name, AncestorSchema.TargetNamespace);
 
                        if(Particle == null)
                        {