我有这样的 XML ,只是想知道我怎么能转换成 C#类
< XML版本=1.0编码=UTF-8&GT?;
< TextScrollerItems的xmlns:XSD =http://www.w3.org/2001/XMLSchema的xmlns:XSI =http://www.w3.org/2001/XMLSchema-instance>
<项目类型=文本ID =234>
<文字颜色=蓝>
示例文本...
< /文字>
< /项目>
<项目类型=形象ID =2456>
<图像>
clientLogo.png
< /图片>
< /项目>
< / TextScrollerItems>
解决方案
给一个尝试xsd.exe工具随Visual Studio中。 下面是一些文档: http://www.$c$cproject.com/Articles/11317/From-XML-to-Strong-Types-in-C
I have this XML and just wondering how I can convert into C# class?
<?xml version="1.0" encoding="utf-8"?>
<TextScrollerItems xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Item type="text" ID="234">
<Text Color="Blue">
Sample text...
</Text>
</Item>
<Item type="image" ID="2456">
<Image>
clientLogo.png
</Image>
</Item>
</TextScrollerItems>
解决方案
give a try to the XSD.exe tool shipped with Visual Studio. Here's some docs: http://www.codeproject.com/Articles/11317/From-XML-to-Strong-Types-in-C
上一篇:翻译FilterDefinition&LT; TDocument&GT;定期JSON蒙戈查询,我可以在蒙戈shell中运行TDocument、LT、FilterDefinition、shell