There is xml . As I understand it, to make class elements with the attributes atr1, atr2 ... is wrong, because if there are more of them and with different id, you will have to create many more properties.
<root> <tag atr1 = "value"/> <tag atr2 = "value"/> <tag3>value</tag3> </root> Question. How to make so that we can set an attribute with any number
Built-in generator gave some sort of porridge
/// <remarks/> [System.SerializableAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)] [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)] public partial class root { private rootTag[] tagField; private string tag3Field; /// <remarks/> [System.Xml.Serialization.XmlElementAttribute("tag")] public rootTag[] tag { get { return this.tagField; } set { this.tagField = value; } } /// <remarks/> public string tag3 { get { return this.tag3Field; } set { this.tag3Field = value; } } } /// <remarks/> [System.SerializableAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)] public partial class rootTag { private string atr1Field; private string atr2Field; /// <remarks/> [System.Xml.Serialization.XmlAttributeAttribute()] public string atr1 { get { return this.atr1Field; } set { this.atr1Field = value; } } /// <remarks/> [System.Xml.Serialization.XmlAttributeAttribute()] public string atr2 { get { return this.atr2Field; } set { this.atr2Field = value; } } }
xmlrather strange, you do not have the opportunity to change it? - user227049