From: Duncan Mak Date: Wed, 27 Mar 2002 02:06:09 +0000 (-0000) Subject: 2002-03-27 Duncan Mak X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=bbca9ecadea4e04f0eda4bf1e2d27e092dce6013;p=mono.git 2002-03-27 Duncan Mak * *.cs: Updates from Ajay Dwivedi . svn path=/trunk/mcs/; revision=3383 --- diff --git a/mcs/class/System.XML/System.Xml.Schema/ChangeLog b/mcs/class/System.XML/System.Xml.Schema/ChangeLog new file mode 100755 index 00000000000..07f428e8aaa --- /dev/null +++ b/mcs/class/System.XML/System.Xml.Schema/ChangeLog @@ -0,0 +1,3 @@ +2002-03-27 Duncan Mak + + * *.cs: Updates from Ajay Dwivedi . \ No newline at end of file diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchema.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchema.cs index d2e9fa10717..e5c021bbdb0 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchema.cs +++ b/mcs/class/System.XML/System.Xml.Schema/XmlSchema.cs @@ -1,7 +1,5 @@ // Author: Dwivedi, Ajay kumar // Adwiv@Yahoo.com -// Author: Dwivedi, Ajay kumar -// Adwiv@Yahoo.com using System; using System.Xml; using System.IO; @@ -13,11 +11,13 @@ namespace System.Xml.Schema /// /// Summary description for XmlSchema. /// - [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); } + // + 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); + } + // [MonoTODO] public static XmlSchema Read(XmlReader reader, ValidationEventHandler validationEventHandler) { - return null; + XmlSerializer xser = new XmlSerializer(typeof(XmlSchema)); + // + xser.UnknownAttribute += new XmlAttributeEventHandler(Serializer_UnknownAttribute); + xser.UnknownElement += new XmlElementEventHandler(Serializer_UnknownElement); + xser.UnknownNode += new XmlNodeEventHandler(Serializer_UnknownNode); + xser.UnreferencedObject += new UnreferencedObjectEventHandler(Serializer_UnknownAttribute); + // + 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(); } } } diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAll.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAll.cs index 63951b71754..c5b1d1c2790 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAll.cs +++ b/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; } diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAnnotated.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAnnotated.cs index b5ced7daf04..ab179dcdd0a 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAnnotated.cs +++ b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAnnotated.cs @@ -9,6 +9,21 @@ namespace System.Xml.Schema /// /// Summary description for XmlSchemaAnnotated. /// + // 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 { diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAnnotation.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAnnotation.cs index a543ff28da4..3b53f03a616 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAnnotation.cs +++ b/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 { diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAny.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAny.cs index bc9ad5d1128..80ce4619902 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAny.cs +++ b/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; } diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAnyAttribute.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAnyAttribute.cs index 4dcb06abb59..6392c84ebb0 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAnyAttribute.cs +++ b/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; } diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAppInfo.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAppInfo.cs index 504be4e66cb..ae060eb7238 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAppInfo.cs +++ b/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; } diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAttribute.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAttribute.cs index 48a67f0234b..41b122de80a 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAttribute.cs +++ b/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;} diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAttributeGroup.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAttributeGroup.cs index a01edc0db7e..1a8795e354d 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAttributeGroup.cs +++ b/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 diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAttributeGroupRef.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAttributeGroupRef.cs index a129cc031bb..371f30fe0ae 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAttributeGroupRef.cs +++ b/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; } } } } diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaChoice.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaChoice.cs index e208d1c73fd..372f6b5ffdf 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaChoice.cs +++ b/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; } diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaCollection.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaCollection.cs index 71c2aad390c..68e1c6b4f7e 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaCollection.cs +++ b/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) { } diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexContent.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexContent.cs index 5a3adc54067..e66cde088b2 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexContent.cs +++ b/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; } diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexContentExtension.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexContentExtension.cs index 5e4f0b00365..95e4d2c5095 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexContentExtension.cs +++ b/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; } diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexContentRestriction.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexContentRestriction.cs index ab221f45832..043704b55f3 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexContentRestriction.cs +++ b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexContentRestriction.cs @@ -9,7 +9,7 @@ namespace System.Xml.Schema /// /// Summary description for XmlSchemaComplexContentRestriction. /// - 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; } diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexType.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexType.cs index e38bc25cfe9..76821253c83 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexType.cs +++ b/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 } } diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaContentProcessing.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaContentProcessing.cs index 2f4b9b6248b..2cd60231a03 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaContentProcessing.cs +++ b/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, } } diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaDerivationMethod.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaDerivationMethod.cs index e4d498d8521..4f2fba2da5a 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaDerivationMethod.cs +++ b/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, diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaDocumentation.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaDocumentation.cs index 2ad0790c906..183ffbab193 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaDocumentation.cs +++ b/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; } + } } } diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaElement.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaElement.cs index 2e946d694f8..fd859cbc6a3 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaElement.cs +++ b/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 } } diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaExternal.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaExternal.cs index 35fe954e742..2f65395e84c 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaExternal.cs +++ b/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; } diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaFacet.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaFacet.cs index 7f139de7f63..ed684395714 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaFacet.cs +++ b/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; } diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaForm.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaForm.cs index 766e3a072e9..8efb7e3d548 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaForm.cs +++ b/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, } } diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaGroup.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaGroup.cs index 5e2d7a16a35..f7abc1f13b4 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaGroup.cs +++ b/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; } diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaGroupRef.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaGroupRef.cs index 081acf1ea12..f8b73c6f34a 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaGroupRef.cs +++ b/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; } diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaIdentityConstraint.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaIdentityConstraint.cs index 5865dd976aa..f7e20a7c184 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaIdentityConstraint.cs +++ b/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; } - } } } diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaImport.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaImport.cs index 6ef493456d2..82798cacaf9 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaImport.cs +++ b/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; } diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaInclude.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaInclude.cs index 095518b9169..405af045a0b 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaInclude.cs +++ b/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; } diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaKeyref.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaKeyref.cs index d9785ac1158..cc3a06792ed 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaKeyref.cs +++ b/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; } diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaNotation.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaNotation.cs index daa90211f04..2320a909d6b 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaNotation.cs +++ b/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; } diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaObject.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaObject.cs index 01f4d3ef315..b0485a2a519 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaObject.cs +++ b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaObject.cs @@ -8,6 +8,12 @@ namespace System.Xml.Schema /// /// Summary description for XmlSchemaObject. /// +// [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 diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaObjectCollection.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaObjectCollection.cs index f9ffd7c3eeb..dade4c20cd4 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaObjectCollection.cs +++ b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaObjectCollection.cs @@ -10,12 +10,14 @@ namespace System.Xml.Schema /// 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); } diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaParticle.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaParticle.cs index 714920440ed..2a3f38b86b8 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaParticle.cs +++ b/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 } } \ No newline at end of file diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaRedefine.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaRedefine.cs index b2286808de8..29c358207a0 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaRedefine.cs +++ b/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; } diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSequence.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSequence.cs index 01ebfaea3db..66295e2d2b1 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSequence.cs +++ b/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; } diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleContent.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleContent.cs index 5ebe0496030..827a37075c3 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleContent.cs +++ b/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; } diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleContentExtension.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleContentExtension.cs index 3e6fa8292d3..eacb8c5bf16 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleContentExtension.cs +++ b/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; } diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleContentRestriction.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleContentRestriction.cs index c173a3aa72e..98e6bb7afd1 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleContentRestriction.cs +++ b/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; } diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleType.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleType.cs index 2171964b109..cd4ffaf62b6 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleType.cs +++ b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleType.cs @@ -8,14 +8,17 @@ namespace System.Xml.Schema /// /// Summary description for XmlSchemaSimpleType. /// - 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; } diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleTypeList.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleTypeList.cs index ff476b81213..560e3551eba 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleTypeList.cs +++ b/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 diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleTypeRestriction.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleTypeRestriction.cs index 65bee4c64b9..fb764b71b2e 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleTypeRestriction.cs +++ b/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; } diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleTypeUnion.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleTypeUnion.cs index 1dffd3e9f25..bca18331f88 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSimpleTypeUnion.cs +++ b/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; } diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaType.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaType.cs index 35365476826..24009448e24 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaType.cs +++ b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaType.cs @@ -10,6 +10,7 @@ namespace System.Xml.Schema /// /// Summary description for XmlSchemaType. /// + [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 } } diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaUse.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaUse.cs index c71039195bc..8015edd8ed2 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaUse.cs +++ b/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, } } diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaXPath.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaXPath.cs index 1831be27fd2..6f3d7c77c19 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaXPath.cs +++ b/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; }