这是一个错误吗?
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:simpleType name="sbrSexItemType">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="1"/>
<xsd:enumeration value="2"/>
<xsd:enumeration value="3"/>
<xsd:enumeration value="0"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:element name="TestSexItemType1" type="sbrSexItemType"/>
<xsd:element name="TestSexItemType2" type="sbrSexItemType"/>
</xsd:schema>
我得到:
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlRootAttribute("TestSexItemType1", Namespace="", IsNullable=false)]
public enum sbrSexItemType {
/// <remarks/>
[System.Xml.Serialization.XmlEnumAttribute("1")]
Item1,
/// <remarks/>
[System.Xml.Serialization.XmlEnumAttribute("2")]
Item2,
/// <remarks/>
[System.Xml.Serialization.XmlEnumAttribute("3")]
Item3,
/// <remarks/>
[System.Xml.Serialization.XmlEnumAttribute("0")]
Item0,
}
这是某种玩笑吗?甚至没有产生错误。生成的代码如何以任何形状或形式表示 XSD?