私が見たのと似た他の例では、ルート ノード、配列ノード、そして一連の配列項目があります。私の問題は、ルート ノードが配列ノードであるため、これまでに見た例がうまくいかないようで、XML スキーマを変更できないことです。XML は次のとおりです。
<articles>
<article>
<guid>7f6da9df-1a91-4e20-8b66-07ac7548dc47</guid>
<order>1</order>
<type>deal_abstract</type>
<textType></textType>
<id></id>
<title>Abu Dhabi's IPIC Eyes Bond Sale After Cepsa Buy</title>
<summary>Abu Dhabi's IPIC has appointed banks for a potential sterling and euro-denominated bond issue, a document showed on Wednesday, after the firm acquired Spain's Cepsa in a $5 billion deal earlier this month...</summary>
<readmore></readmore>
<fileName></fileName>
<articleDate>02/24/2011 00:00:00 AM</articleDate>
<articleDateType></articleDateType>
</article>
<article>
<guid>1c3e57a0-c471-425a-87dd-051e69ecb7c5</guid>
<order>2</order>
<type>deal_abstract</type>
<textType></textType>
<id></id>
<title>Big Law Abuzz Over New China Security Review</title>
<summary>China’s newly established foreign investment M&A review committee has been the subject of much legal chatter in the Middle Kingdom and beyond. Earlier this month, the State Council unveiled legislative guidance on…</summary>
<readmore></readmore>
<fileName></fileName>
<articleDate>02/23/2011 00:00:00 AM</articleDate>
<articleDateType></articleDateType>
</article>
</articles>
これが私のクラスです:
public class CurrentsResultsList
{
public Article[] Articles;
}
public class Article
{
public string Guid { get; set; }
public int Order { get; set; }
public string Type { get; set; }
public string Title { get; set; }
public string Summary { get; set; }
public DateTime ArticleDate { get; set; }
}
これは、外部 API からの XML 応答です。