xml片段:
...
<invoiceID value=""/>
<invUNP value=""/>
<invDateCreate value=""/>
...
使用xsd获取下一个代码
[System.Xml.Serialization.XmlElementAttribute("invoiceID",Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public getInvoiceReplyInvoiceID[] invoiceID;
public partial class getInvoiceReplyInvoiceID {
[System.Xml.Serialization.XmlAttributeAttribute()]
public string value;
}
这段代码不简单
使用http://xmltocsharp.azurewebsites.net/获取c#代码
...
[XmlRoot(ElementName = "invoiceID")]
public class InvoiceID
{
[XmlAttribute(AttributeName = "value")]
public string Value { get; set; }
}
[XmlRoot(ElementName = "invUNP")]
public class InvUNP
{
[XmlAttribute(AttributeName = "value")]
public string Value { get; set; }
}
[XmlElement(ElementName = "invoiceID")]
public InvoiceID InvoiceID { get; set; }
[XmlElement(ElementName = "invUNP")]
public InvUNP InvUNP { get; set; }
...
如何获得下一个c#类?
...
[XmlElement(ElementName = "invoiceID")]
public string InvoiceID { get; set; }
[XmlElement(ElementName = "invUNP")]
public string InvUNP { get; set; }
...
可能使用svcutil.exe? 或写自解析器?