快速测试:
<test>
<i>123</i>
<f>12.3</f>
<s>abc</s>
</test>
xsd test.xml
xsd test.xsd /c
给予:
<xs:element name="test">
<xs:complexType>
<xs:sequence>
<xs:element name="i" type="xs:string" minOccurs="0" />
<xs:element name="f" type="xs:string" minOccurs="0" />
<xs:element name="s" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
以及:
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string i {
get {
return this.iField;
}
set {
this.iField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string f {
get {
return this.fField;
}
set {
this.fField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string s {
get {
return this.sField;
}
set {
this.sField = value;
}
}