Kaynağa Gözat

2002-03-27 Duncan Mak <[email protected]>

	* *.cs: Updates from Ajay Dwivedi <[email protected]>.

svn path=/trunk/mcs/; revision=3383
Duncan Mak 24 yıl önce
ebeveyn
işleme
bbca9ecade
46 değiştirilmiş dosya ile 621 ekleme ve 303 silme
  1. 3 0
      mcs/class/System.XML/System.Xml.Schema/ChangeLog
  2. 127 20
      mcs/class/System.XML/System.Xml.Schema/XmlSchema.cs
  3. 1 1
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaAll.cs
  4. 23 5
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaAnnotated.cs
  5. 8 3
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaAnnotation.cs
  6. 6 5
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaAny.cs
  7. 5 5
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaAnyAttribute.cs
  8. 2 1
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaAppInfo.cs
  9. 19 13
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaAttribute.cs
  10. 8 3
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaAttributeGroup.cs
  11. 3 6
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaAttributeGroupRef.cs
  12. 6 1
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaChoice.cs
  13. 2 2
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaCollection.cs
  14. 6 4
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexContent.cs
  15. 16 9
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexContentExtension.cs
  16. 17 10
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexContentRestriction.cs
  17. 55 35
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexType.cs
  18. 3 3
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaContentProcessing.cs
  19. 7 7
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaDerivationMethod.cs
  20. 10 7
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaDocumentation.cs
  21. 84 55
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaElement.cs
  22. 6 4
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaExternal.cs
  23. 3 3
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaFacet.cs
  24. 2 2
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaForm.cs
  25. 6 3
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaGroup.cs
  26. 1 1
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaGroupRef.cs
  27. 12 8
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaIdentityConstraint.cs
  28. 4 2
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaImport.cs
  29. 1 1
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaInclude.cs
  30. 3 2
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaKeyref.cs
  31. 3 3
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaNotation.cs
  32. 7 0
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaObject.cs
  33. 9 7
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaObjectCollection.cs
  34. 48 27
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaParticle.cs
  35. 6 1
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaRedefine.cs
  36. 6 1
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaSequence.cs
  37. 3 1
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleContent.cs
  38. 6 3
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleContentExtension.cs
  39. 27 10
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleContentRestriction.cs
  40. 5 2
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleType.cs
  41. 5 3
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleTypeList.cs
  42. 17 3
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleTypeRestriction.cs
  43. 5 3
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleTypeUnion.cs
  44. 20 13
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaType.cs
  45. 3 3
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaUse.cs
  46. 2 2
      mcs/class/System.XML/System.Xml.Schema/XmlSchemaXPath.cs

+ 3 - 0
mcs/class/System.XML/System.Xml.Schema/ChangeLog

@@ -0,0 +1,3 @@
+2002-03-27  Duncan Mak  <[email protected]>
+
+	* *.cs: Updates from Ajay Dwivedi <[email protected]>.

+ 127 - 20
mcs/class/System.XML/System.Xml.Schema/XmlSchema.cs

@@ -1,7 +1,5 @@
 // Author: Dwivedi, Ajay kumar
 //            [email protected]
-// Author: Dwivedi, Ajay kumar
-//            [email protected]
 using System;
 using System.Xml;
 using System.IO;
@@ -13,11 +11,13 @@ namespace System.Xml.Schema
 	/// <summary>
 	/// Summary description for XmlSchema.
 	/// </summary>
-	[XmlRoot] 
+	[XmlRoot("schema",Namespace="http://www.w3.org/2001/XMLSchema")]
 	public class XmlSchema : XmlSchemaObject
 	{
 		//public constants
+		[XmlIgnore]
 		public const string InstanceNamespace = "http://www.w3.org/2001/XMLSchema-instance";
+		[XmlIgnore]
 		public const string Namespace = "http://www.w3.org/2001/XMLSchema";
 
 		//private fields
@@ -37,8 +37,8 @@ namespace System.Xml.Schema
 		private XmlSchemaObjectTable schemaTypes ;
 		private string targetNamespace ;
 		private XmlAttribute[] unhandledAttributes ;
-		private string version ;
-
+		private string version;
+		private string language;
 
 		public XmlSchema()
 		{
@@ -50,108 +50,150 @@ namespace System.Xml.Schema
 			isCompiled			= false;
 			items				= new XmlSchemaObjectCollection();
 		}
+
+		#region Properties
+
 		[DefaultValue(XmlSchemaForm.None)]
-		[XmlAttribute]
+		[System.Xml.Serialization.XmlAttribute("attributeFormDefault")]
 		public XmlSchemaForm AttributeFormDefault 
 		{
 			get{ return attributeFormDefault; }
 			set{ this.attributeFormDefault = value;}
 		}
+
 		[XmlIgnore]
 		public XmlSchemaObjectTable AttributeGroups 
 		{
 			get{ return attributeGroups; }
 		}
+		
 		[XmlIgnore]
 		public XmlSchemaObjectTable Attributes 
 		{
 			get{ return attributes;}
 		}
+		
 		[DefaultValue(XmlSchemaDerivationMethod.None)]
-		[XmlAttribute]
+		[System.Xml.Serialization.XmlAttribute("blockDefault")]
 		public XmlSchemaDerivationMethod BlockDefault 
 		{
 			get{ return blockDefault;}
 			set{ blockDefault = value;}
 		}
+		
 		[DefaultValue(XmlSchemaForm.None)]
-		[XmlAttribute]
+		[System.Xml.Serialization.XmlAttribute("elementFormDefault")]
 		public XmlSchemaForm ElementFormDefault 
 		{
 			get{ return elementFormDefault;}
 			set{ elementFormDefault = value;}
 		}
+
 		[XmlIgnore]
 		public XmlSchemaObjectTable Elements 
 		{
 			get{ return elements;}
 		}
+
 		[DefaultValue(XmlSchemaDerivationMethod.None)]
-		[XmlAttribute]
+		[System.Xml.Serialization.XmlAttribute("finalDefault")]
 		public XmlSchemaDerivationMethod FinalDefault 
 		{
 			get{ return finalDefault;}
 			set{ finalDefault = value;}
 		}
+
 		[XmlIgnore]
 		public XmlSchemaObjectTable Groups 
 		{
 			get{ return groups;}
 		}
-		[XmlAttribute]
+
+		[System.Xml.Serialization.XmlAttribute("id")]
 		public string Id 
 		{
 			get{ return id;}
 			set{ id = value;}
 		}
-		[XmlElement]
+		
+		[XmlElement("include",typeof(XmlSchemaInclude),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("import",typeof(XmlSchemaImport),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("redefine",typeof(XmlSchemaRedefine),Namespace="http://www.w3.org/2001/XMLSchema")]
 		public XmlSchemaObjectCollection Includes 
 		{
 			get{ return includes;}
 		}
+		
 		[XmlIgnore]
 		public bool IsCompiled 
 		{
 			get{ return isCompiled;}
 		}
-		[XmlElement]
+		
+		[XmlElement("simpleType",typeof(XmlSchemaSimpleType),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("complexType",typeof(XmlSchemaComplexType),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("group",typeof(XmlSchemaGroup),Namespace="http://www.w3.org/2001/XMLSchema")]
+		//Only Schema's attributeGroup has type XmlSchemaAttributeGroup.
+		//Others (complextype, restrictions etc) must have XmlSchemaAttributeGroupRef
+		[XmlElement("attributeGroup",typeof(XmlSchemaAttributeGroup),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("element",typeof(XmlSchemaElement),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("attribute",typeof(XmlSchemaAttribute),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("notation",typeof(XmlSchemaNotation),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("annotation",typeof(XmlSchemaAnnotation),Namespace="http://www.w3.org/2001/XMLSchema")]
 		public XmlSchemaObjectCollection Items 
 		{
 			get{ return items;}
 		}
+		
 		[XmlIgnore]
 		public XmlSchemaObjectTable Notations 
 		{
 			get{ return notations;}
 		}
+		
 		[XmlIgnore]
 		public XmlSchemaObjectTable SchemaTypes 
 		{
 			get{ return schemaTypes;}
 		}
-		[XmlAttribute]
+		
+		[System.Xml.Serialization.XmlAttribute("targetNamespace")]
 		public string TargetNamespace 
 		{
 			get{ return targetNamespace;}
 			set{ targetNamespace = value;}
 		}
+		
 		[XmlAnyAttribute]
 		public XmlAttribute[] UnhandledAttributes 
 		{
 			get{ return unhandledAttributes;}
 			set{ unhandledAttributes = value;}
 		}
-		[XmlAttribute]
+		
+		[System.Xml.Serialization.XmlAttribute("version")]
 		public string Version 
 		{
 			get{ return version;}
 			set{ version = value;}
 		}
 
+		// New attribute defined in W3C schema element
+		[System.Xml.Serialization.XmlAttribute("xml:lang")]
+		public string Language
+		{
+			get{ return  language; }
+			set{ language = value; }
+		}
+
+		#endregion
+
 		// Methods
 		[MonoTODO]
-		public void Compile(System.Xml.Schema.ValidationEventHandler validationEventHandler)
+		public void Compile(ValidationEventHandler validationEventHandler)
 		{
+			attributeGroups = null;
+
 		}
 
 		public static XmlSchema Read(TextReader reader, ValidationEventHandler validationEventHandler)
@@ -162,19 +204,54 @@ namespace System.Xml.Schema
 		{
 			return Read(new XmlTextReader(stream),validationEventHandler);
 		}
+		//<ToBeRemoved>
+		private static void Serializer_UnknownAttribute(object sender, XmlAttributeEventArgs e)
+		{
+			Console.WriteLine("Unknown Attribute");
+			Console.WriteLine("\t" + e.Attr.Name + " " + e.Attr.InnerXml);
+			Console.WriteLine("\t LineNumber: " + e.LineNumber);
+			Console.WriteLine("\t LinePosition: " + e.LinePosition);
+		}
+		private static void Serializer_UnknownElement(object sender, XmlElementEventArgs e)
+		{
+			Console.WriteLine("Unknown Element");
+			Console.WriteLine("\t" + e.Element.Name + " " + e.Element.InnerXml);
+			Console.WriteLine("\t LineNumber: " + e.LineNumber);
+			Console.WriteLine("\t LinePosition: " + e.LinePosition);
+		}
+		private static void Serializer_UnknownNode(object sender, XmlNodeEventArgs e)
+		{
+			Console.WriteLine("Unknown Node");
+			Console.WriteLine("\t" + e.Name + " " + e.Text);
+			Console.WriteLine("\t LineNumber: " + e.LineNumber);
+			Console.WriteLine("\t LinePosition: " + e.LinePosition);
+		}
+		private static void Serializer_UnknownAttribute(object sender, UnreferencedObjectEventArgs e)
+		{
+			Console.WriteLine("Unknown");
+			Console.WriteLine("\t" + e.UnreferencedId);
+			Console.WriteLine("\t" + e.UnreferencedObject);
+		}
+		//</ToBeRemoved>
 		[MonoTODO]
 		public static XmlSchema Read(XmlReader reader, ValidationEventHandler validationEventHandler)
 		{
-			return null;
+			XmlSerializer xser = new XmlSerializer(typeof(XmlSchema));
+			//<ToBeRemoved>
+			xser.UnknownAttribute +=  new XmlAttributeEventHandler(Serializer_UnknownAttribute);
+			xser.UnknownElement +=  new XmlElementEventHandler(Serializer_UnknownElement);
+			xser.UnknownNode +=  new XmlNodeEventHandler(Serializer_UnknownNode);
+			xser.UnreferencedObject +=  new UnreferencedObjectEventHandler(Serializer_UnknownAttribute);
+			//</ToBeRemoved>
+			return (XmlSchema) xser.Deserialize(reader);
 		}
-
 		public void Write(System.IO.Stream stream)
 		{
-			Write(new XmlTextWriter(stream,null),null);
+			Write(stream,null);
 		}
 		public void Write(System.IO.TextWriter writer)
 		{
-			Write(new XmlTextWriter(writer),null);
+			Write(writer,null);
 		}
 		public void Write(System.Xml.XmlWriter writer)
 		{
@@ -186,11 +263,41 @@ namespace System.Xml.Schema
 		}
 		public void Write(System.IO.TextWriter writer, System.Xml.XmlNamespaceManager namespaceManager)
 		{
-			Write(new XmlTextWriter(writer),namespaceManager);
+			XmlTextWriter xwriter = new XmlTextWriter(writer);
+			// This is why the Write was not writing schema with line breaks
+			xwriter.Formatting = Formatting.Indented;
+			Write(xwriter,namespaceManager);
 		}
 		[MonoTODO]
 		public void Write(System.Xml.XmlWriter writer, System.Xml.XmlNamespaceManager namespaceManager)
 		{
+			XmlSerializerNamespaces xns;
+			
+			if(Namespaces != null)
+			{
+				xns = new XmlSerializerNamespaces(this.Namespaces);
+			}
+			else
+			{
+				xns = new XmlSerializerNamespaces();
+			}
+
+			if(namespaceManager != null)
+			{
+				foreach(string name in namespaceManager)
+				{
+					//xml and xmlns namespaced are added by default in namespaceManager. 
+					//So we should ignore them
+					if(name!="xml" && name != "xmlns")
+						xns.Add(name,namespaceManager.LookupNamespace(name));
+				}
+			}
+			
+			this.Namespaces = xns;
+			
+			XmlSerializer xser = new XmlSerializer(typeof(XmlSchema));
+			xser.Serialize(writer,this,xns);
+			writer.Flush();
 		}
 	}
 }

+ 1 - 1
mcs/class/System.XML/System.Xml.Schema/XmlSchemaAll.cs

@@ -15,7 +15,7 @@ namespace System.Xml.Schema
 		{
 			items = new XmlSchemaObjectCollection();
 		}
-		[XmlElement]
+		[XmlElement("element",typeof(XmlSchemaElement),Namespace="http://www.w3.org/2001/XMLSchema")]
 		public override XmlSchemaObjectCollection Items 
 		{
 			get{ return items; }

+ 23 - 5
mcs/class/System.XML/System.Xml.Schema/XmlSchemaAnnotated.cs

@@ -9,6 +9,21 @@ namespace System.Xml.Schema
 	/// <summary>
 	/// Summary description for XmlSchemaAnnotated.
 	/// </summary>
+	// Include all childrens of this class
+//	[XmlInclude(typeof(XmlSchemaAnyAttribute)),
+//	XmlInclude(typeof(XmlSchemaAttribute)),
+//	XmlInclude(typeof(XmlSchemaAttributeGroup)),
+//	XmlInclude(typeof(XmlSchemaAttributeGroupRef)),
+//	XmlInclude(typeof(XmlSchemaContent)),
+//	XmlInclude(typeof(XmlSchemaContentModel)),
+//	XmlInclude(typeof(XmlSchemaFacet)),
+//	XmlInclude(typeof(XmlSchemaGroup)),
+//	XmlInclude(typeof(XmlSchemaIdentityConstraint)),
+//	XmlInclude(typeof(XmlSchemaNotation)),
+//	XmlInclude(typeof(XmlSchemaParticle)),
+//	XmlInclude(typeof(XmlSchemaSimpleTypeContent)),
+//	XmlInclude(typeof(XmlSchemaType)),
+//	XmlInclude(typeof(XmlSchemaXPath))]
 	public class XmlSchemaAnnotated : XmlSchemaObject
 	{
 		private XmlSchemaAnnotation annotation;
@@ -17,18 +32,21 @@ namespace System.Xml.Schema
 
 		public XmlSchemaAnnotated()
 		{}
-		[XmlElement]
+		
+		[XmlElement("annotation",Namespace="http://www.w3.org/2001/XMLSchema")]
 		public XmlSchemaAnnotation Annotation 
 		{ 
-			get{ return this.annotation; } 
-			set{ this.annotation = value; } 
+			get{ return  annotation; } 
+			set{ annotation = value; } 
 		}
-		[XmlAttribute]
+		
+		[System.Xml.Serialization.XmlAttribute("id")]
 		public string Id 
 		{ 
-			get{ return this.id; } 
+			get{ return  id; } 
 			set{ id = value; } 
 		}
+		
 		[XmlAnyAttribute]
 		public XmlAttribute[] UnhandledAttributes 
 		{ 

+ 8 - 3
mcs/class/System.XML/System.Xml.Schema/XmlSchemaAnnotation.cs

@@ -17,18 +17,23 @@ namespace System.Xml.Schema
 
 		public XmlSchemaAnnotation()
 		{
+			items = new XmlSchemaObjectCollection();
 		}
-		[XmlAttribute]
+
+		[System.Xml.Serialization.XmlAttribute("id")]
 		public string Id 
 		{
 			get{ return  id; } 
 			set{ id = value; }
 		}
-		[XmlElement]
-		public XmlSchemaObjectCollection Items 
+		
+		[XmlElement("appinfo",typeof(XmlSchemaAppInfo),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("documentation",typeof(XmlSchemaDocumentation),Namespace="http://www.w3.org/2001/XMLSchema")]
+		public XmlSchemaObjectCollection Items
 		{
 			get{ return items; }
 		}
+		
 		[XmlAnyAttribute]
 		public XmlAttribute[] UnhandledAttributes 
 		{

+ 6 - 5
mcs/class/System.XML/System.Xml.Schema/XmlSchemaAny.cs

@@ -17,17 +17,18 @@ namespace System.Xml.Schema
 		public XmlSchemaAny()
 		{
 			nameSpace = string.Empty;
-			processing = XmlSchemaContentProcessing.Strict;
 		}
-		[XmlAttribute]
+
+		[System.Xml.Serialization.XmlAttribute("namespace")]
 		public string Namespace 
 		{
 			get{ return  nameSpace; } 
 			set{ nameSpace = value; }
 		}
-		[DefaultValue(XmlSchemaContentProcessing.Strict)]
-		[XmlAttribute]
-		public XmlSchemaContentProcessing ProcessContents 
+		
+		[DefaultValue(XmlSchemaContentProcessing.None)]
+		[System.Xml.Serialization.XmlAttribute("processContents")]
+		public XmlSchemaContentProcessing ProcessContents
 		{ 
 			get{ return processing; } 
 			set{ processing = value; }

+ 5 - 5
mcs/class/System.XML/System.Xml.Schema/XmlSchemaAnyAttribute.cs

@@ -12,22 +12,22 @@ namespace System.Xml.Schema
 	public class XmlSchemaAnyAttribute : XmlSchemaAnnotated
 	{
 		private string nameSpace;
-		public XmlSchemaContentProcessing processing;
+		private XmlSchemaContentProcessing processing;
 
 		public XmlSchemaAnyAttribute()
 		{
 			nameSpace = string.Empty;
-			this.processing = XmlSchemaContentProcessing.Strict;
 		}
 
-		[XmlAttribute]
+		[System.Xml.Serialization.XmlAttribute("namespace")]
 		public string Namespace 
 		{ 
 			get{ return nameSpace; } 
 			set{ nameSpace = value; } 
 		}
-		[DefaultValue(XmlSchemaContentProcessing.Strict)]
-		[XmlAttribute]
+		
+		[DefaultValue(XmlSchemaContentProcessing.None)]
+		[System.Xml.Serialization.XmlAttribute("processContents")]
 		public XmlSchemaContentProcessing ProcessContents 
 		{ 
 			get{ return processing; } 

+ 2 - 1
mcs/class/System.XML/System.Xml.Schema/XmlSchemaAppInfo.cs

@@ -26,7 +26,8 @@ namespace System.Xml.Schema
 			get{ return  markup; }
 			set{ markup = value; }
 		}
-		[XmlAttribute]
+
+		[System.Xml.Serialization.XmlAttribute("source")]
 		public string Source 
 		{
 			get{ return  source; } 

+ 19 - 13
mcs/class/System.XML/System.Xml.Schema/XmlSchemaAttribute.cs

@@ -27,7 +27,7 @@ namespace System.Xml.Schema
 		{
 			//FIXME: Docs says the default is optional.
 			//Whereas the MS implementation has default None.
-			use = XmlSchemaUse.Optional;
+			use = XmlSchemaUse.None;
 			qualifiedName = XmlQualifiedName.Empty;
 			refName = XmlQualifiedName.Empty;
 		}
@@ -38,9 +38,9 @@ namespace System.Xml.Schema
 		{ //FIXME: This is not correct. Is it?
 			get{ return attributeType; }
 		}
-		//FIXME: what is the default value?
-		[DefaultValue("")]
-		[XmlAttribute]
+
+		[DefaultValue(null)]
+		[System.Xml.Serialization.XmlAttribute("default")]
 		public string DefaultValue 
 		{
 			get{ return defaultValue;}
@@ -50,8 +50,9 @@ namespace System.Xml.Schema
 				defaultValue = value;
 			}
 		}
-		[DefaultValue("")]
-		[XmlAttribute]
+
+		[DefaultValue(null)]
+		[System.Xml.Serialization.XmlAttribute("fixed")]
 		public string FixedValue 
 		{
 			get{ return fixedValue;}
@@ -61,14 +62,16 @@ namespace System.Xml.Schema
 				fixedValue = value;
 			}
 		}
+
 		[DefaultValue(XmlSchemaForm.None)]
-		[XmlAttribute]
+		[System.Xml.Serialization.XmlAttribute("form")]
 		public XmlSchemaForm Form 
 		{
 			get{ return form;}
 			set{ form = value;}
 		}
-		[XmlAttribute]
+
+		[System.Xml.Serialization.XmlAttribute("name")]
 		public string Name 
 		{
 			get{ return name;}
@@ -84,7 +87,7 @@ namespace System.Xml.Schema
 			get{ return qualifiedName;}
 		}
 
-		[XmlAttribute]
+		[System.Xml.Serialization.XmlAttribute("ref")]
 		public XmlQualifiedName RefName 
 		{
 			get{ return refName;}
@@ -94,20 +97,23 @@ namespace System.Xml.Schema
 				refName = value; 
 			}
 		}
-		[XmlElement]
+
+		[XmlElement("simpleType",Namespace="http://www.w3.org/2001/XMLSchema")]
 		public XmlSchemaSimpleType SchemaType 
 		{
 			get{ return schemaType;}
 			set{ schemaType = value;}
 		}
-		[XmlAttribute]
+		
+		[System.Xml.Serialization.XmlAttribute("type")]
 		public XmlQualifiedName SchemaTypeName 
 		{
 			get{ return schemaTypeName;}
 			set{ schemaTypeName = value;}
 		}
-		[DefaultValue(XmlSchemaUse.Optional)]
-		[XmlAttribute]
+
+		[DefaultValue(XmlSchemaUse.None)]
+		[System.Xml.Serialization.XmlAttribute("use")]
 		public XmlSchemaUse Use 
 		{
 			get{ return use;}

+ 8 - 3
mcs/class/System.XML/System.Xml.Schema/XmlSchemaAttributeGroup.cs

@@ -21,23 +21,28 @@ namespace System.Xml.Schema
 			//FIXME:
 			redefined  = this;
 		}
-		[XmlElement]
+
+		[XmlElement("anyAttribute",Namespace="http://www.w3.org/2001/XMLSchema")]
 		public XmlSchemaAnyAttribute AnyAttribute 
 		{
 			get{ return any;}
 			set{ any = value;}
 		}
-		[XmlElement]
+
+		[XmlElement("attribute",typeof(XmlSchemaAttribute),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("attributeGroup",typeof(XmlSchemaAttributeGroupRef),Namespace="http://www.w3.org/2001/XMLSchema")]
 		public XmlSchemaObjectCollection Attributes 
 		{
 			get{ return attributes;}
 		}
-		[XmlAttribute]
+
+		[System.Xml.Serialization.XmlAttribute("name")]
 		public string Name 
 		{
 			get{ return name;}
 			set{ name = value;}
 		}
+
 		//Undocumented property
 		[XmlIgnore]
 		public XmlSchemaAttributeGroup RedefinedAttributeGroup 

+ 3 - 6
mcs/class/System.XML/System.Xml.Schema/XmlSchemaAttributeGroupRef.cs

@@ -16,14 +16,11 @@ namespace System.Xml.Schema
 		public XmlSchemaAttributeGroupRef()
 		{}
 		
-		[XmlAttribute]
+		[System.Xml.Serialization.XmlAttribute("ref")]
 		public XmlQualifiedName RefName 
 		{
-			get{ return refName;}
-			set
-			{
-				refName = value; 
-			}
+			get{ return  refName; }
+			set{ refName = value; }
 		}
 	}
 }

+ 6 - 1
mcs/class/System.XML/System.Xml.Schema/XmlSchemaChoice.cs

@@ -15,7 +15,12 @@ namespace System.Xml.Schema
 		{
 			items = new XmlSchemaObjectCollection();
 		}
-		[XmlElement]
+
+		[XmlElement("element",typeof(XmlSchemaElement),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("group",typeof(XmlSchemaGroupRef),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("choice",typeof(XmlSchemaChoice),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("sequence",typeof(XmlSchemaSequence),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("any",typeof(XmlSchemaAny),Namespace="http://www.w3.org/2001/XMLSchema")]
 		public override XmlSchemaObjectCollection Items 
 		{
 			get{ return items; }

+ 2 - 2
mcs/class/System.XML/System.Xml.Schema/XmlSchemaCollection.cs

@@ -84,11 +84,11 @@ namespace System.Xml.Schema
 		{
 			return this.htable.Contains(ns);
 		}
-		public bool Contains(System.Xml.Schema.XmlSchema schema)
+		public bool Contains(XmlSchema schema)
 		{
 			return this.htable.Contains(schema.TargetNamespace); 
 		}
-		public void CopyTo(System.Xml.Schema.XmlSchema[] array, int index)
+		public void CopyTo(XmlSchema[] array, int index)
 		{
 
 		}

+ 6 - 4
mcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexContent.cs

@@ -14,15 +14,17 @@ namespace System.Xml.Schema
 		private bool isMixed;
 
 		public XmlSchemaComplexContent()
-		{
-		}
-		[XmlElement]
+		{}
+
+		[XmlElement("restriction",typeof(XmlSchemaComplexContentRestriction),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("extension",typeof(XmlSchemaComplexContentExtension),Namespace="http://www.w3.org/2001/XMLSchema")]
 		public override XmlSchemaContent Content 
 		{
 			get{ return  content; } 
 			set{ content = value; }
 		}
-		[XmlAttribute]
+
+		[System.Xml.Serialization.XmlAttribute("mixed")]
 		public bool IsMixed 
 		{
 			get{ return  isMixed; } 

+ 16 - 9
mcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexContentExtension.cs

@@ -19,24 +19,31 @@ namespace System.Xml.Schema
 		{
 			attributes = new XmlSchemaObjectCollection();
 		}
-		[XmlElement]
+		
+		[System.Xml.Serialization.XmlAttribute("base")]
+		public XmlQualifiedName BaseTypeName 
+		{
+			get{ return  baseTypeName; }
+			set{ baseTypeName = value; }
+		}
+		[XmlElement("anyAttribute",Namespace="http://www.w3.org/2001/XMLSchema")]
 		public XmlSchemaAnyAttribute AnyAttribute 
 		{
 			get{ return any; }
 			set{ any = value;}
 		}
-		[XmlElement]
+
+		[XmlElement("attribute",typeof(XmlSchemaAttribute),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("attributeGroup",typeof(XmlSchemaAttributeGroupRef),Namespace="http://www.w3.org/2001/XMLSchema")]
 		public XmlSchemaObjectCollection Attributes 
 		{
 			get{ return attributes; }
 		}
-		[XmlAttribute]
-		public XmlQualifiedName BaseTypeName 
-		{
-			get{ return  baseTypeName; }
-			set{ baseTypeName = value; }
-		}
-		[XmlElement]
+
+		[XmlElement("group",typeof(XmlSchemaGroupRef),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("all",typeof(XmlSchemaAll),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("choice",typeof(XmlSchemaChoice),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("sequence",typeof(XmlSchemaSequence),Namespace="http://www.w3.org/2001/XMLSchema")]
 		public XmlSchemaParticle Particle
 		{
 			get{ return  particle; }

+ 17 - 10
mcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexContentRestriction.cs

@@ -9,7 +9,7 @@ namespace System.Xml.Schema
 	/// <summary>
 	/// Summary description for XmlSchemaComplexContentRestriction.
 	/// </summary>
-	public class XmlSchemaComplexContentRestriction
+	public class XmlSchemaComplexContentRestriction : XmlSchemaContent
 	{
 		private XmlSchemaAnyAttribute any;
 		private XmlSchemaObjectCollection attributes;
@@ -22,24 +22,31 @@ namespace System.Xml.Schema
 			attributes	 = new XmlSchemaObjectCollection();
 		}
 
-		[XmlElement]
+		[System.Xml.Serialization.XmlAttribute("base")]
+		public XmlQualifiedName BaseTypeName 
+		{
+			get{ return  baseTypeName; }
+			set{ baseTypeName = value; }
+		}
+
+		[XmlElement("anyAttribute",Namespace="http://www.w3.org/2001/XMLSchema")]
 		public XmlSchemaAnyAttribute AnyAttribute 
 		{
 			get{ return  any; }
 			set{ any = value; }
 		}
-		[XmlElement]
+
+		[XmlElement("attribute",typeof(XmlSchemaAttribute),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("attributeGroup",typeof(XmlSchemaAttributeGroupRef),Namespace="http://www.w3.org/2001/XMLSchema")]
 		public XmlSchemaObjectCollection Attributes 
 		{
 			get{ return attributes; }
 		}
-		[XmlAttribute]
-		public XmlQualifiedName BaseTypeName 
-		{
-			get{ return  baseTypeName; }
-			set{ baseTypeName = value; }
-		}
-		[XmlElement]
+
+		[XmlElement("group",typeof(XmlSchemaGroupRef),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("all",typeof(XmlSchemaAll),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("choice",typeof(XmlSchemaChoice),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("sequence",typeof(XmlSchemaSequence),Namespace="http://www.w3.org/2001/XMLSchema")]
 		public XmlSchemaParticle Particle 
 		{
 			get{ return  particle; }

+ 55 - 35
mcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexType.cs

@@ -27,20 +27,72 @@ namespace System.Xml.Schema
 
 		public XmlSchemaComplexType()
 		{
+			attributes = new XmlSchemaObjectCollection();
 			block = XmlSchemaDerivationMethod.None;
 		}
 
-		[XmlElement]
+		#region Attributes
+
+		[DefaultValue(XmlSchemaDerivationMethod.None)]
+		[System.Xml.Serialization.XmlAttribute("block")]
+		public XmlSchemaDerivationMethod Block
+		{
+			get{ return  block; }
+			set{ block = value; }
+		}
+		[DefaultValue(false)]
+		[System.Xml.Serialization.XmlAttribute("abstract")]
+		public bool IsAbstract 
+		{
+			get{ return  isAbstract; }
+			set{ isAbstract = value; }
+		}
+		[DefaultValue(false)]
+		[System.Xml.Serialization.XmlAttribute("mixed")]
+		public override bool IsMixed
+		{
+			get{ return  isMixed; }
+			set{ isMixed = value; }
+		}
+		
+		#endregion
+		
+		#region Elements
+		[XmlElement("anyAttribute",Namespace="http://www.w3.org/2001/XMLSchema")]
 		public XmlSchemaAnyAttribute AnyAttribute 
 		{
 			get{ return  anyAttribute; }
 			set{ anyAttribute = value; }
 		}
-		[XmlElement]
+
+		[XmlElement("attribute",typeof(XmlSchemaAttribute),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("attributeGroup",typeof(XmlSchemaAttributeGroupRef),Namespace="http://www.w3.org/2001/XMLSchema")]
 		public XmlSchemaObjectCollection Attributes 
 		{
 			get{ return attributes; }
 		}
+		
+		[XmlElement("simpleContent",typeof(XmlSchemaSimpleContent),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("complexContent",typeof(XmlSchemaComplexContent),Namespace="http://www.w3.org/2001/XMLSchema")]
+		public XmlSchemaContentModel ContentModel 
+		{
+			get{ return  contentModel; } 
+			set{ contentModel = value; }
+		}
+
+		[XmlElement("group",typeof(XmlSchemaGroupRef),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("all",typeof(XmlSchemaAll),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("choice",typeof(XmlSchemaChoice),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("sequence",typeof(XmlSchemaSequence),Namespace="http://www.w3.org/2001/XMLSchema")]
+		public XmlSchemaParticle Particle 
+		{
+			get{ return  particle; } 
+			set{ particle = value; }
+		}
+
+		#endregion
+
+		#region XmlIgnore
 		[XmlIgnore]
 		public XmlSchemaObjectTable AttributeUses 
 		{
@@ -51,24 +103,11 @@ namespace System.Xml.Schema
 		{
 			get{ return attributeWildcard; }
 		}
-		[DefaultValue(XmlSchemaDerivationMethod.None)]
-		[XmlAttribute]
-		public XmlSchemaDerivationMethod Block 
-		{
-			get{ return  block; }
-			set{ block = value; }
-		}
 		[XmlIgnore]
 		public XmlSchemaDerivationMethod BlockResolved 
 		{
 			get{ return blockResolved; }
 		}
-		[XmlElement]
-		public XmlSchemaContentModel ContentModel 
-		{
-			get{ return  contentModel; } 
-			set{ contentModel = value; }
-		}
 		[XmlIgnore]
 		public XmlSchemaContentType ContentType 
 		{
@@ -79,25 +118,6 @@ namespace System.Xml.Schema
 		{
 			get{ return contentTypeParticle; }
 		}
-		[DefaultValue(true)]
-		[XmlAttribute]
-		public bool IsAbstract 
-		{
-			get{ return  isAbstract; }
-			set{ isAbstract = value; }
-		}
-		[DefaultValue(true)]
-		[XmlAttribute]
-		public override bool IsMixed
-		{
-			get{ return  isMixed; }
-			set{ isMixed = value; }
-		}
-		[XmlElement]
-		public XmlSchemaParticle Particle 
-		{
-			get{ return  particle; } 
-			set{ particle = value; }
-		}
+		#endregion
 	}
 }

+ 3 - 3
mcs/class/System.XML/System.Xml.Schema/XmlSchemaContentProcessing.cs

@@ -12,11 +12,11 @@ namespace System.Xml.Schema
 	{
 		[XmlIgnore]
 		None	= 0,
-		[XmlEnum]
+		[XmlEnum("skip")]
 		Skip	= 1,
-		[XmlEnum]
+		[XmlEnum("lax")]
 		Lax		= 2, 
-		[XmlEnum]
+		[XmlEnum("strict")]
 		Strict	= 3, 
 	}
 }

+ 7 - 7
mcs/class/System.XML/System.Xml.Schema/XmlSchemaDerivationMethod.cs

@@ -11,19 +11,19 @@ namespace System.Xml.Schema
 	[Flags]
 	public enum XmlSchemaDerivationMethod
 	{
-		[XmlEnum]
+		[XmlEnum("empty")]
 		Empty		= 0x00000000, 
-		[XmlEnum]
+		[XmlEnum("substitution")]
 		Substitution= 0x00000001, 
-		[XmlEnum]
+		[XmlEnum("extension")]
 		Extension	= 0x00000002, 
-		[XmlEnum]
+		[XmlEnum("restriction")]
 		Restriction	= 0x00000004, 
-		[XmlEnum]
+		[XmlEnum("list")]
 		List		= 0x00000008, 
-		[XmlEnum]
+		[XmlEnum("union")]
 		Union		= 0x00000010, 
-		[XmlEnum]
+		[XmlEnum("#all")]
 		All			= 0x000000FF,
 		[XmlIgnore]
 		None		= 0x00000100, 

+ 10 - 7
mcs/class/System.XML/System.Xml.Schema/XmlSchemaDocumentation.cs

@@ -19,12 +19,7 @@ namespace System.Xml.Schema
 		{
 			source = string.Empty;
 		}
-		[XmlAttribute]
-		public string Language 
-		{
-			get{ return  language; }
-			set{ language = value; }
-		}
+
 		[XmlAnyElement]
 		[XmlText]
 		public XmlNode[] Markup 
@@ -32,11 +27,19 @@ namespace System.Xml.Schema
 			get{ return  markup; }
 			set{ markup = value; }
 		}
-		[XmlAttribute]
+		
+		[System.Xml.Serialization.XmlAttribute("source")]
 		public string Source 
 		{
 			get{ return  source; } 
 			set{ source = value; }
 		}
+
+		[System.Xml.Serialization.XmlAttribute("xml:lang")]
+		public string Language 
+		{
+			get{ return  language; }
+			set{ language = value; }
+		}
 	}
 }

+ 84 - 55
mcs/class/System.XML/System.Xml.Schema/XmlSchemaElement.cs

@@ -33,117 +33,146 @@ namespace System.Xml.Schema
 		public XmlSchemaElement()
 		{
 			block = XmlSchemaDerivationMethod.None;
-			constraints = new XmlSchemaObjectCollection();
 			final = XmlSchemaDerivationMethod.None;
-			finalResolved = XmlSchemaDerivationMethod.None;
-			name = string.Empty;
+			constraints = new XmlSchemaObjectCollection();
 			qName = XmlQualifiedName.Empty;
 			substitutionGroup = XmlQualifiedName.Empty;
 		}
+
+		#region Attributes
+		
+		[DefaultValue(false)]
+		[System.Xml.Serialization.XmlAttribute("abstract")]
+		public bool IsAbstract 
+		{
+			get{ return  isAbstract; }
+			set{ isAbstract = value; }
+		}
+
 		[DefaultValue(XmlSchemaDerivationMethod.None)]
-		[XmlAttribute]
+		[System.Xml.Serialization.XmlAttribute("block")]
 		public XmlSchemaDerivationMethod Block 
 		{
 			get{ return  block; }
 			set{ block = value; }
 		}
-		[XmlIgnore]
-		public XmlSchemaDerivationMethod BlockResolved 
-		{
-			get{ return blockResolved; }
-		}
-		[XmlElement]
-		public XmlSchemaObjectCollection Constraints 
-		{
-			get{ return constraints; }
-		}
-		[DefaultValue("")]
-		[XmlAttribute]
+		
+		[DefaultValue(null)]
+		[System.Xml.Serialization.XmlAttribute("default")]
 		public string DefaultValue 
 		{
 			get{ return  defaultValue; }
 			set{ defaultValue = value; }
 		}
-		[XmlIgnore]
-		public object ElementType 
-		{
-			get{ return elementType; }
-		}
+		
 		[DefaultValue(XmlSchemaDerivationMethod.None)]
-		[XmlAttribute]
+		[System.Xml.Serialization.XmlAttribute("final")]
 		public XmlSchemaDerivationMethod Final 
 		{
 			get{ return  final; }
 			set{ final = value; }
 		}
-		[XmlIgnore]
-		public XmlSchemaDerivationMethod FinalResolved 
-		{
-			get{ return finalResolved; }
-		}
-		[DefaultValue("")]
-		[XmlAttribute]
+
+		[DefaultValue(null)]
+		[System.Xml.Serialization.XmlAttribute("fixed")]
 		public string FixedValue 
 		{
 			get{ return  fixedValue; }
 			set{ fixedValue = value; }
 		}
 		[DefaultValue(XmlSchemaForm.None)]
-		[XmlAttribute]
+		[System.Xml.Serialization.XmlAttribute("form")]
 		public XmlSchemaForm Form 
 		{
 			get{ return  form; }
 			set{ form = value; }
 		}
-		[DefaultValue(true)]
-		[XmlAttribute]
-		public bool IsAbstract 
-		{
-			get{ return  isAbstract; }
-			set{ isAbstract = value; }
-		}
+
 		[DefaultValue(false)]
-		[XmlAttribute]
+		[System.Xml.Serialization.XmlAttribute("nillable")]
 		public bool IsNillable 
 		{
 			get{ return  isNillable; }
 			set{ isNillable = value; }
 		}
-		[DefaultValue("")]
-		[XmlAttribute]
+
+		[DefaultValue(null)]
+		[System.Xml.Serialization.XmlAttribute("name")]
 		public string Name 
 		{
 			get{ return  name; }
 			set{ name = value; }
 		}
-		[XmlIgnore]
-		public XmlQualifiedName QualifiedName 
-		{
-			get{ return qName; }
-		}
-		[XmlAttribute]
+		[System.Xml.Serialization.XmlAttribute("ref")]
 		public XmlQualifiedName RefName 
 		{
 			get{ return  refName; }
 			set{ refName = value;}
 		}
-		[XmlElement]
-		public XmlSchemaType SchemaType 
-		{
-			get{ return  schemaType; }
-			set{ schemaType = value; }
-		}
-		[XmlAttribute]
+		
+		[System.Xml.Serialization.XmlAttribute("type")]
 		public XmlQualifiedName SchemaTypeName 
 		{
 			get{ return  schemaTypeName; }
 			set{ schemaTypeName = value; }
 		}
-		[XmlAttribute]
-		public XmlQualifiedName SubstitutionGroup 
+
+		[System.Xml.Serialization.XmlAttribute("substitutionGroup")]
+		public XmlQualifiedName SubstitutionGroup
 		{
 			get{ return  substitutionGroup; }
 			set{ substitutionGroup = value; }
 		}
+
+
+		#endregion
+
+		#region Elements
+		
+		[XmlElement("unique",typeof(XmlSchemaUnique),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("key",typeof(XmlSchemaKey),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("keyref",typeof(XmlSchemaKeyref),Namespace="http://www.w3.org/2001/XMLSchema")]
+		public XmlSchemaObjectCollection Constraints 
+		{
+			get{ return constraints; }
+		}
+
+		[XmlElement("simpleType",typeof(XmlSchemaSimpleType),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("complexType",typeof(XmlSchemaComplexType),Namespace="http://www.w3.org/2001/XMLSchema")]
+		public XmlSchemaType SchemaType 
+		{
+			get{ return  schemaType; }
+			set{ schemaType = value; }
+		}
+		
+		#endregion
+
+		#region XmlIgnore
+		[XmlIgnore]
+		public XmlSchemaDerivationMethod BlockResolved 
+		{
+			get{ return blockResolved; }
+		}
+
+		[XmlIgnore]
+		public object ElementType 
+		{
+			get{ return elementType; }
+		}
+		
+		[XmlIgnore]
+		public XmlSchemaDerivationMethod FinalResolved 
+		{
+			get{ return finalResolved; }
+		}
+
+		[XmlIgnore]
+		public XmlQualifiedName QualifiedName 
+		{
+			get{ return qName; }
+		}
+
+
+		#endregion
 	}
 }

+ 6 - 4
mcs/class/System.XML/System.Xml.Schema/XmlSchemaExternal.cs

@@ -17,21 +17,23 @@ namespace System.Xml.Schema
 		private XmlAttribute[] unhandledAttributes;
 
 		protected XmlSchemaExternal()
-		{
-		}
-		[XmlAttribute]
+		{}
+
+		[System.Xml.Serialization.XmlAttribute("id")]
 		public string Id 
 		{
 			get{ return  id; }
 			set{ id = value; }
 		}
+
 		[XmlIgnore]
 		public XmlSchema Schema 
 		{
 			get{ return  schema; }
 			set{ schema = value; }
 		}
-		[XmlAttribute]
+		
+		[System.Xml.Serialization.XmlAttribute("schemaLocation")]
 		public string SchemaLocation 
 		{
 			get{ return  location; } 

+ 3 - 3
mcs/class/System.XML/System.Xml.Schema/XmlSchemaFacet.cs

@@ -20,14 +20,14 @@ namespace System.Xml.Schema
 			val = string.Empty;
 		}
 		[DefaultValue(false)]
-		[XmlAttribute]
+		[System.Xml.Serialization.XmlAttribute("fixed")]
 		public virtual bool IsFixed 
 		{
 			get{ return  isFixed; }
 			set{ isFixed = value; }
 		}
-		[XmlAttribute]
-		public string Value 
+		[System.Xml.Serialization.XmlAttribute("value")]
+		public string Value
 		{
 			get{ return  val; } 
 			set{ val = value; }

+ 2 - 2
mcs/class/System.XML/System.Xml.Schema/XmlSchemaForm.cs

@@ -11,9 +11,9 @@ namespace System.Xml.Schema
 	{
 		[XmlIgnore]
 		None = 0x00000000, 
-		[XmlEnum]
+		[XmlEnum("qualified")]
 		Qualified = 0x00000001, 
-		[XmlEnum]
+		[XmlEnum("unqualified")]
 		Unqualified = 0x00000002, 
 	}
 }

+ 6 - 3
mcs/class/System.XML/System.Xml.Schema/XmlSchemaGroup.cs

@@ -15,15 +15,18 @@ namespace System.Xml.Schema
 
 		public XmlSchemaGroup()
 		{
-			name = string.Empty;
 		}
-		[XmlAttribute]
+
+		[System.Xml.Serialization.XmlAttribute("name")]
 		public string Name 
 		{
 			get{ return  name; } 
 			set{ name = value; }
 		}
-		[XmlElement]
+
+		[XmlElement("all",typeof(XmlSchemaAll),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("choice",typeof(XmlSchemaChoice),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("sequence",typeof(XmlSchemaSequence),Namespace="http://www.w3.org/2001/XMLSchema")]
 		public XmlSchemaGroupBase Particle
 		{
 			get{ return  particle; }

+ 1 - 1
mcs/class/System.XML/System.Xml.Schema/XmlSchemaGroupRef.cs

@@ -21,7 +21,7 @@ namespace System.Xml.Schema
 		{
 			get{ return particle; }
 		}
-		[XmlAttribute]
+		[System.Xml.Serialization.XmlAttribute("ref")]
 		public XmlQualifiedName RefName 
 		{
 			get{ return  refName; } 

+ 12 - 8
mcs/class/System.XML/System.Xml.Schema/XmlSchemaIdentityConstraint.cs

@@ -21,27 +21,31 @@ namespace System.Xml.Schema
 			fields = new XmlSchemaObjectCollection();
 			qName = XmlQualifiedName.Empty;
 		}
-		[XmlElement]
+
+		[XmlElement("field",typeof(XmlSchemaXPath),Namespace="http://www.w3.org/2001/XMLSchema")]
 		public XmlSchemaObjectCollection Fields 
 		{
 			get{ return fields; }
 		}
-		[XmlAttribute]
+
+		[XmlElement("selector",typeof(XmlSchemaXPath),Namespace="http://www.w3.org/2001/XMLSchema")]
+		public XmlSchemaXPath Selector 
+		{
+			get{ return  selector; } 
+			set{ selector = value; }
+		}
+		
+		[System.Xml.Serialization.XmlAttribute("name")]
 		public string Name 
 		{
 			get{ return  name; } 
 			set{ name = value; }
 		}
+		
 		[XmlIgnore]
 		public XmlQualifiedName QualifiedName 
 		{
 			get{ return  qName; }
 		}
-		[XmlElement]
-		public XmlSchemaXPath Selector 
-		{
-			get{ return  selector; } 
-			set{ selector = value; }
-		}
 	}
 }

+ 4 - 2
mcs/class/System.XML/System.Xml.Schema/XmlSchemaImport.cs

@@ -15,13 +15,15 @@ namespace System.Xml.Schema
 		public XmlSchemaImport()
 		{
 		}
-		[XmlElement]
+
+		[XmlElement("annotation",Namespace="http://www.w3.org/2001/XMLSchema")]
 		public XmlSchemaAnnotation Annotation 
 		{
 			get{ return  annotation; } 
 			set{ annotation = value; }
 		}
-		[XmlAttribute]
+		
+		[System.Xml.Serialization.XmlAttribute("namespace")]
 		public string Namespace 
 		{
 			get{ return  nameSpace; } 

+ 1 - 1
mcs/class/System.XML/System.Xml.Schema/XmlSchemaInclude.cs

@@ -14,7 +14,7 @@ namespace System.Xml.Schema
 		public XmlSchemaInclude()
 		{
 		}
-		[XmlElement]
+		[XmlElement("annotation",Namespace="http://www.w3.org/2001/XMLSchema")]
 		public XmlSchemaAnnotation Annotation 
 		{
 			get{ return  annotation; } 

+ 3 - 2
mcs/class/System.XML/System.Xml.Schema/XmlSchemaKeyref.cs

@@ -16,8 +16,9 @@ namespace System.Xml.Schema
 		public XmlSchemaKeyref()
 		{
 		}
-		[XmlAttribute]
-		public XmlQualifiedName Refer 
+
+		[System.Xml.Serialization.XmlAttribute("refer")]
+		public XmlQualifiedName Refer
 		{
 			get{ return  refer; } 
 			set{ refer = value; }

+ 3 - 3
mcs/class/System.XML/System.Xml.Schema/XmlSchemaNotation.cs

@@ -17,19 +17,19 @@ namespace System.Xml.Schema
 		public XmlSchemaNotation()
 		{
 		}
-		[XmlAttribute]
+		[System.Xml.Serialization.XmlAttribute("name")]
 		public string Name 
 		{
 			get{ return  name; } 
 			set{ name = value; }
 		}
-		[XmlAttribute]
+		[System.Xml.Serialization.XmlAttribute("public")]
 		public string Public 
 		{
 			get{ return  pub; } 
 			set{ pub = value; }
 		}
-		[XmlAttribute]
+		[System.Xml.Serialization.XmlAttribute("system")]
 		public string System 
 		{
 			get{ return  system; } 

+ 7 - 0
mcs/class/System.XML/System.Xml.Schema/XmlSchemaObject.cs

@@ -8,6 +8,12 @@ namespace System.Xml.Schema
 	/// <summary>
 	/// Summary description for XmlSchemaObject.
 	/// </summary>
+//	[XmlInclude(typeof(XmlSchema)),
+//	XmlInclude(typeof(XmlSchemaAnnotated)),
+//	XmlInclude(typeof(XmlSchemaAnnotation)),
+//	XmlInclude(typeof(XmlSchemaAppInfo)),
+//	XmlInclude(typeof(XmlSchemaDocumentation)),
+//	XmlInclude(typeof(XmlSchemaExternal))]
 	public abstract class XmlSchemaObject
 	{
 		private int lineNumber;
@@ -36,6 +42,7 @@ namespace System.Xml.Schema
 			get{ return sourceUri; } 
 			set{ sourceUri = value; } 
 		}
+
 		// Undocumented Property
 		[XmlNamespaceDeclarations]
 		public XmlSerializerNamespaces Namespaces 

+ 9 - 7
mcs/class/System.XML/System.Xml.Schema/XmlSchemaObjectCollection.cs

@@ -10,12 +10,14 @@ namespace System.Xml.Schema
 	/// </summary>
 	public class XmlSchemaObjectCollection : System.Collections.CollectionBase
 	{
+		private XmlSchemaObject parent;
+
 		public XmlSchemaObjectCollection()
 		{
 		}
-		[MonoTODO]
 		public XmlSchemaObjectCollection(XmlSchemaObject parent)
 		{
+			this.parent = parent;
 		}
 
 		// Properties
@@ -32,17 +34,17 @@ namespace System.Xml.Schema
 		}
 
 		// Methods
-		public int Add(System.Xml.Schema.XmlSchemaObject item)
+		public int  Add(XmlSchemaObject item)
 		{
 			return this.List.Add(item);
 		}
 		
-		public bool Contains(System.Xml.Schema.XmlSchemaObject item)
+		public bool Contains(XmlSchemaObject item)
 		{
 			return this.List.Contains(item);
 		}
 		
-		public void CopyTo(System.Xml.Schema.XmlSchemaObject[] array, int index)
+		public void CopyTo(XmlSchemaObject[] array, int index)
 		{
 			this.List.CopyTo(array,index);
 		}
@@ -53,12 +55,12 @@ namespace System.Xml.Schema
 			return (XmlSchemaObjectEnumerator) new object();
 		}
 		
-		public int IndexOf(System.Xml.Schema.XmlSchemaObject item)
+		public int IndexOf(XmlSchemaObject item)
 		{
 			return this.List.IndexOf(item);
 		}
 		
-		public void Insert(int index, System.Xml.Schema.XmlSchemaObject item)
+		public void Insert(int index, XmlSchemaObject item)
 		{
 			this.List.Insert(index, item);
 		}
@@ -72,7 +74,7 @@ namespace System.Xml.Schema
 		[MonoTODO]
 		protected override void OnSet(int index,object oldValue,object newValue){}
 
-		public void Remove(System.Xml.Schema.XmlSchemaObject item)
+		public void Remove(XmlSchemaObject item)
 		{
 			this.List.Remove(item);
 		}

+ 48 - 27
mcs/class/System.XML/System.Xml.Schema/XmlSchemaParticle.cs

@@ -18,59 +18,80 @@ namespace System.Xml.Schema
 			minOccurs = decimal.One;
 			maxOccurs = decimal.One;
 		}
-		[XmlIgnore]
-		public decimal MaxOccurs 
+
+		#region Attributes
+
+		[System.Xml.Serialization.XmlAttribute("maxOccurs")]
+		public string MaxOccursString
 		{
-			get{ return  maxOccurs; } 
+			get{ return maxstr; }
 			set
 			{
-				if(value >= 0 && (value == Decimal.Truncate(value)))
-					maxOccurs = value;
+				if(value == "unbounded")
+				{
+					maxstr = value;
+					maxOccurs = decimal.MaxValue;
+				}
 				else
-					throw new XmlSchemaException("MaxOccurs must be a non-negative number",null);
+				{
+					decimal val = decimal.Parse(value);
+					if(val >= 0 && (val == Decimal.Truncate(val)))
+					{
+						maxOccurs = val;
+						maxstr = value;
+					}
+					else
+					{
+						throw new XmlSchemaException
+							("MaxOccurs must be a non-negative integer",null);
+					}
+				}
 			}
 		}
-		[XmlAttribute]
-		public string MaxOccursString 
+
+		[System.Xml.Serialization.XmlAttribute("minOccurs")]
+		public string MinOccursString
 		{
-			get{ return maxstr; }
+			get{ return minstr; }
 			set
 			{
-				if(value == "unbounded")
+				decimal val = decimal.Parse(value);
+				if(val >= 0 && (val == Decimal.Truncate(val)))
 				{
-					maxstr = value;
-					maxOccurs = decimal.MaxValue;
+					minOccurs = val;
+					minstr	 = value;
 				}
 				else
 				{
-					decimal val = decimal.Parse(value);
-					//Setting through the property
-					MaxOccurs = val;
-					maxstr = value;
+					throw new XmlSchemaException
+						("MinOccursString must be a non-negative number",null); 					
 				}
 			}
 		}
+
+		#endregion
+
+		#region XmlIgnore
+
 		[XmlIgnore]
-		public decimal MinOccurs
+		public decimal MaxOccurs 
 		{
-			get{ return  minOccurs; }
+			get{ return  maxOccurs; } 
 			set
 			{
-				if(value >= 0 && (value == Decimal.Truncate(value)))
-					minOccurs = value;
-				else
-					throw new XmlSchemaException("MinOccursString must be a non-negative number",null); 					
+				MaxOccursString = value.ToString();
 			}
 		}
-		[XmlAttribute]
-		public string MinOccursString
+
+		[XmlIgnore]
+		public decimal MinOccurs
 		{
-			get{ return minstr; }
+			get{ return  minOccurs; }
 			set
 			{
-				MinOccurs = decimal.Parse(value);
-				minstr = value;
+				MinOccursString = value.ToString();
 			}
 		}
+		#endregion
 	}
 }

+ 6 - 1
mcs/class/System.XML/System.Xml.Schema/XmlSchemaRedefine.cs

@@ -28,7 +28,12 @@ namespace System.Xml.Schema
 		{
 			get{ return groups; }
 		}
-		[XmlElement]
+		[XmlElement("annotation",typeof(XmlSchemaAnnotation),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("simpleType",typeof(XmlSchemaSimpleType),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("complexType",typeof(XmlSchemaComplexType),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("group",typeof(XmlSchemaGroup),Namespace="http://www.w3.org/2001/XMLSchema")]
+		//NOTE: AttributeGroup and not AttributeGroupRef
+		[XmlElement("attributeGroup",typeof(XmlSchemaAttributeGroup),Namespace="http://www.w3.org/2001/XMLSchema")]
 		public XmlSchemaObjectCollection Items 
 		{
 			get{ return items; }

+ 6 - 1
mcs/class/System.XML/System.Xml.Schema/XmlSchemaSequence.cs

@@ -15,7 +15,12 @@ namespace System.Xml.Schema
 		{
 			items = new XmlSchemaObjectCollection();
 		}
-		[XmlElement]
+
+		[XmlElement("element",typeof(XmlSchemaElement),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("group",typeof(XmlSchemaGroupRef),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("choice",typeof(XmlSchemaChoice),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("sequence",typeof(XmlSchemaSequence),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("any",typeof(XmlSchemaAny),Namespace="http://www.w3.org/2001/XMLSchema")]
 		public override XmlSchemaObjectCollection Items 
 		{
 			get{ return items; }

+ 3 - 1
mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleContent.cs

@@ -15,7 +15,9 @@ namespace System.Xml.Schema
 		public XmlSchemaSimpleContent()
 		{
 		}
-		[XmlElement]
+
+		[XmlElement("restriction",typeof(XmlSchemaSimpleContentRestriction),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("extension",typeof(XmlSchemaSimpleContentExtension),Namespace="http://www.w3.org/2001/XMLSchema")]
 		public override XmlSchemaContent Content 
 		{
 			get{ return  content; } 

+ 6 - 3
mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleContentExtension.cs

@@ -22,18 +22,21 @@ namespace System.Xml.Schema
 			attributes	 = new XmlSchemaObjectCollection();
 		}
 
-		[XmlElement]
+		[XmlElement("anyAttribute",Namespace="http://www.w3.org/2001/XMLSchema")]
 		public XmlSchemaAnyAttribute AnyAttribute 
 		{
 			get{ return  any; }
 			set{ any = value; }
 		}
-		[XmlElement]
+
+		[XmlElement("attribute",typeof(XmlSchemaAttribute),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("attributeGroup",typeof(XmlSchemaAttributeGroupRef),Namespace="http://www.w3.org/2001/XMLSchema")]
 		public XmlSchemaObjectCollection Attributes 
 		{
 			get{ return attributes; }
 		}
-		[XmlAttribute]
+
+		[System.Xml.Serialization.XmlAttribute("base")]
 		public XmlQualifiedName BaseTypeName 
 		{
 			get{ return  baseTypeName; }

+ 27 - 10
mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleContentRestriction.cs

@@ -25,30 +25,47 @@ namespace System.Xml.Schema
 			facets		 = new XmlSchemaObjectCollection();
 		}
 
-		[XmlElement]
+		[System.Xml.Serialization.XmlAttribute("base")]
+		public XmlQualifiedName BaseTypeName 
+		{
+			get{ return  baseTypeName; }
+			set{ baseTypeName = value; }
+		}
+
+		[XmlElement("anyAttribute",Namespace="http://www.w3.org/2001/XMLSchema")]
 		public XmlSchemaAnyAttribute AnyAttribute 
 		{
 			get{ return  any; }
 			set{ any = value; }
 		}
-		[XmlElement]
+
+		[XmlElement("attribute",typeof(XmlSchemaAttribute),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("attributeGroup",typeof(XmlSchemaAttributeGroupRef),Namespace="http://www.w3.org/2001/XMLSchema")]
 		public XmlSchemaObjectCollection Attributes 
 		{
 			get{ return attributes; }
 		}
-		[XmlElement]
+
+		[XmlElement("simpleType",Namespace="http://www.w3.org/2001/XMLSchema")]
 		public XmlSchemaSimpleType BaseType 
 		{ 
 			get{ return  baseType; } 
 			set{ baseType = value; } 
 		}
-		[XmlAttribute]
-		public XmlQualifiedName BaseTypeName 
-		{
-			get{ return  baseTypeName; }
-			set{ baseTypeName = value; }
-		}
-		[XmlElement]
+		
+		
+		[XmlElement("minExclusive",typeof(XmlSchemaMinExclusiveFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("minInclusive",typeof(XmlSchemaMinInclusiveFacet),Namespace="http://www.w3.org/2001/XMLSchema")] 
+		[XmlElement("maxExclusive",typeof(XmlSchemaMaxExclusiveFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("maxInclusive",typeof(XmlSchemaMaxInclusiveFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("totalDigits",typeof(XmlSchemaTotalDigitsFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("fractionDigits",typeof(XmlSchemaFractionDigitsFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("length",typeof(XmlSchemaLengthFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("minLength",typeof(XmlSchemaMinLengthFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("maxLength",typeof(XmlSchemaMaxLengthFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("enumeration",typeof(XmlSchemaEnumerationFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("whiteSpace",typeof(XmlSchemaWhiteSpaceFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("pattern",typeof(XmlSchemaPatternFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
 		public XmlSchemaObjectCollection Facets 
 		{ 
 			get{ return facets; } 

+ 5 - 2
mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleType.cs

@@ -8,14 +8,17 @@ namespace System.Xml.Schema
 	/// <summary>
 	/// Summary description for XmlSchemaSimpleType.
 	/// </summary>
-	public class XmlSchemaSimpleType
+	public class XmlSchemaSimpleType : XmlSchemaType
 	{
 		private XmlSchemaSimpleTypeContent content;
 
 		public XmlSchemaSimpleType()
 		{
 		}
-		[XmlElement]
+
+		[XmlElement("restriction",typeof(XmlSchemaSimpleTypeRestriction),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("list",typeof(XmlSchemaSimpleTypeList),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("union",typeof(XmlSchemaSimpleTypeUnion),Namespace="http://www.w3.org/2001/XMLSchema")]
 		public XmlSchemaSimpleTypeContent Content
 		{
 			get{ return  content; } 

+ 5 - 3
mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleTypeList.cs

@@ -17,7 +17,8 @@ namespace System.Xml.Schema
 
 		public XmlSchemaSimpleTypeList()
 		{}
-		[XmlElement]
+
+		[XmlElement("simpleType",Namespace="http://www.w3.org/2001/XMLSchema")]
 		public XmlSchemaSimpleType ItemType 
 		{
 			get{ return itemType; } 
@@ -27,8 +28,9 @@ namespace System.Xml.Schema
 				itemTypeName = null;
 			}
 		}
-		[XmlAttribute]
-		public XmlQualifiedName ItemTypeName 
+
+		[System.Xml.Serialization.XmlAttribute("itemType")]
+		public XmlQualifiedName ItemTypeName
 		{
 			get{ return itemTypeName; } 
 			set

+ 17 - 3
mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleTypeRestriction.cs

@@ -19,19 +19,33 @@ namespace System.Xml.Schema
 		{
 			facets = new XmlSchemaObjectCollection();
 		}
-		[XmlElement]
+
+		[XmlElement("simpleType",Namespace="http://www.w3.org/2001/XMLSchema")]
 		public XmlSchemaSimpleType BaseType 
 		{
 			get{ return  baseType; } 
 			set{ baseType = value; }
 		}
-		[XmlAttribute]
+
+		[System.Xml.Serialization.XmlAttribute("base")]
 		public XmlQualifiedName BaseTypeName 
 		{
 			get{ return  baseTypeName; } 
 			set{ baseTypeName = value; }
 		}
-		[XmlElement]
+
+		[XmlElement("minExclusive",typeof(XmlSchemaMinExclusiveFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("minInclusive",typeof(XmlSchemaMinInclusiveFacet),Namespace="http://www.w3.org/2001/XMLSchema")] 
+		[XmlElement("maxExclusive",typeof(XmlSchemaMaxExclusiveFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("maxInclusive",typeof(XmlSchemaMaxInclusiveFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("totalDigits",typeof(XmlSchemaTotalDigitsFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("fractionDigits",typeof(XmlSchemaFractionDigitsFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("length",typeof(XmlSchemaLengthFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("minLength",typeof(XmlSchemaMinLengthFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("maxLength",typeof(XmlSchemaMaxLengthFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("enumeration",typeof(XmlSchemaEnumerationFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("whiteSpace",typeof(XmlSchemaWhiteSpaceFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
+		[XmlElement("pattern",typeof(XmlSchemaPatternFacet),Namespace="http://www.w3.org/2001/XMLSchema")]
 		public XmlSchemaObjectCollection Facets 
 		{
 			get{ return facets; }

+ 5 - 3
mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleTypeUnion.cs

@@ -18,13 +18,15 @@ namespace System.Xml.Schema
 		{
 			baseTypes = new XmlSchemaObjectCollection();
 		}
-		[XmlElement]
+
+		[XmlElement("simpleType",typeof(XmlSchemaSimpleType),Namespace="http://www.w3.org/2001/XMLSchema")]
 		public XmlSchemaObjectCollection BaseTypes 
 		{
 			get{ return baseTypes; }
 		}
-		[XmlAttribute]
-		public XmlQualifiedName[] MemberTypes 
+
+		[System.Xml.Serialization.XmlAttribute("memberTypes")]
+		public XmlQualifiedName[] MemberTypes
 		{
 			get{ return  memberTypes; } 
 			set{ memberTypes = value; }

+ 20 - 13
mcs/class/System.XML/System.Xml.Schema/XmlSchemaType.cs

@@ -10,6 +10,7 @@ namespace System.Xml.Schema
 	/// <summary>
 	/// Summary description for XmlSchemaType.
 	/// </summary>
+	[XmlInclude(typeof(XmlSchemaSimpleType))]
 	public class XmlSchemaType : XmlSchemaAnnotated
 	{
 		private object baseSchemaType;
@@ -25,6 +26,24 @@ namespace System.Xml.Schema
 		{
 			final = XmlSchemaDerivationMethod.None;
 		}
+
+		#region Attributes
+		[System.Xml.Serialization.XmlAttribute("name")]
+		public string Name 
+		{
+			get{ return name; }
+			set{ name = value; }
+		}
+		[DefaultValue(XmlSchemaDerivationMethod.None)]
+		[System.Xml.Serialization.XmlAttribute("final")]
+		public XmlSchemaDerivationMethod Final 
+		{
+			get{ return  final; }
+			set{ final = value; }
+		}
+		#endregion
+
+		#region XmlIgnore
 		[XmlIgnore]
 		public object BaseSchemaType 
 		{
@@ -40,13 +59,6 @@ namespace System.Xml.Schema
 		{
 			get{ return derivedBy; }
 		}
-		[DefaultValue(XmlSchemaDerivationMethod.None)]
-		[XmlAttribute]
-		public XmlSchemaDerivationMethod Final 
-		{
-			get{ return  final; }
-			set{ final = value; }
-		}
 		[XmlIgnore]
 		public XmlSchemaDerivationMethod FinalResolved 
 		{
@@ -58,16 +70,11 @@ namespace System.Xml.Schema
 			get{ return  isMixed; }
 			set{ isMixed = value; } 
 		}
-		[XmlAttribute]
-		public string Name 
-		{
-			get{ return name; }
-			set{ name = value; }
-		}
 		[XmlIgnore]
 		public XmlQualifiedName QualifiedName 
 		{
 			get{ return qName; }
 		}
+		#endregion
 	}
 }

+ 3 - 3
mcs/class/System.XML/System.Xml.Schema/XmlSchemaUse.cs

@@ -12,11 +12,11 @@ namespace System.Xml.Schema
 	{
 		[XmlIgnore]
 		None = 0x00000000, 
-		[XmlEnum]
+		[XmlEnum("optional")]
 		Optional = 0x00000001, 
-		[XmlEnum]
+		[XmlEnum("prohibited")]
 		Prohibited = 0x00000002, 
-		[XmlEnum]
+		[XmlEnum("required")]
 		Required = 0x00000003, 
 	}
 }

+ 2 - 2
mcs/class/System.XML/System.Xml.Schema/XmlSchemaXPath.cs

@@ -16,8 +16,8 @@ namespace System.Xml.Schema
 		public XmlSchemaXPath()
 		{
 		}
-		[DefaultValue("")]
-		[XmlAttribute]
+		[DefaultValue(null)]
+		[System.Xml.Serialization.XmlAttribute("xpath")]
 		public string XPath 
 		{
 			get{ return  xpath; }