В моем XSD-файле содержится следующий фрагмент кода:
<xs:complexType name="CONSIDERATION" mixed="true">
<xs:complexContent mixed="true">
<xs:restriction base="xs:anyType">
<xs:attribute name="_Description" type="xs:anySimpleType"/>
<xs:attribute name="_Type" type="xs:anySimpleType" use="required"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
Я использую утилиту Microsoft XSD для создания строго типизированного класса.Теперь, когда я хочу назначить «_Description» и «_Type», я не нахожу эти атрибуты в классе.Сгенерированный класс имеет следующий код для класса:
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=false)]
public partial class CONSIDERATION {
private string[] textField;
/// <remarks/>
[System.Xml.Serialization.XmlTextAttribute()]
public string[] Text {
get {
return this.textField;
}
set {
this.textField = value;
}
}
}
Для присвоения ему значения доступно только свойство Text.Как я могу присвоить значение описанию и типу атрибута?