问题描述
我有以下示例XML和.NET类型,我认为这些类型是XMLSerializer
可以使用的正确属性,但是我只是获得了类型中的空值。我在不同的地方尝试了各种属性,但无法填充类型。
[<CLIMutable>]
[<XmlTypeAttribute("ROW")>]
type MyItem =
{ Id: string
At: string
Latitude: double
Longitude: double
RegNum: string }
[<CLIMutable>]
[<XmlTypeAttribute(AnonymousType = true)>]
type MyRowset =
{ [<XmlArrayAttribute("ROW")>]
items: MyItem [] }
[<CLIMutable>]
[<XmlTypeAttribute("ROWSET")>]
type Myresult =
{ [<XmlElementAttribute("ROWSET")>]
rowset: MyRowset }
[<CLIMutable>]
[<XmlTypeAttribute(AnonymousType = true)>]
[<XmlRootAttribute(Namespace = "",IsNullable = false,ElementName = "RESPONSE")>]
type MyResponse =
{ [<XmlElementAttribute("RESULT")>]
result: Myresult }
//<RESPONSE>
// <RESULT>
// <ROWSET>
// <ROW>
// </ROW>
// </ROWSET>
// </RESULT>
//</RESPONSE>
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)