タイトルをより具体的に表現できないことをお詫びしますが、例を挙げて説明することしかできません.
次の XML にシリアル化するクラスを構築しようとしています
<Customize>
<Content></Content>
<Content></Content>
<!-- i.e. a list of Content -->
<Command></Command>
<Command></Command>
<Command></Command>
<!-- i.e. a list of Command -->
</Customize>
私のC#は:
[XmlRoot]
public Customize Customize { get; set; }
と
public class Customize
{
public List<Content> Content { get; set; }
public List<Command> Command { get; set; }
}
ただし、これにより、(当然のことながら) 次の結果が生成されます。
<Customize>
<Content>
<Content></Content>
<Content></Content>
</Content>
<Command>
<Command></Command>
<Command></Command>
<Command></Command>
</Command>
</Customize>
目的の xml を実現するのに役立つ xml シリアル化属性がいくつかありますか、それともクラスを記述する別の方法を見つける必要がありますか?