私はXMLの初心者です。基本的に、次のようなクラスがあります。
public class Items:List<string>
{
private string _name;
public string Product
{
get {return _name;}
set {_name=value;}
}
}
次のように、このクラスに基づいてオブジェクトをシリアル化したい:
<Items>
<Product>product name</Product>
<Item> A1 </Item>
<Item> A2 </Item>
<Item> A3 </Item>
<Item> A4 </Item>
<Item> A5 </Item>
</Items>
私の質問は、このオブジェクトをシリアル化しようとしたときです.XMLシリアル化プログラムは製品要素を無視し、このXMLデータのみを取得しました:
<Items>
<Item> A1 </Item>
<Item> A2 </Item>
<Item> A3 </Item>
<Item> A4 </Item>
<Item> A5 </Item>
</Items>
誰でも正しい形式の XML ドキュメントを取得するのを手伝ってくれます。