如下的xml
<?xml version="1.0" encoding="UTF-8" ?>
<body>
<question>
<enabled>true</enabled>
<description>问题</description>
<answer>
<a-enabled>true</a-enabled>
<isright>true</isright>
<a-description>答案1</a-description>
</answer>
<answer>
<a-enabled>true</a-enabled>
<isright>false</isright>
<a-description>答案2</a-description>
</answer>
</question>
<question>
<enabled>true</enabled>
<description>问题2</description>
<answer>
<a-enabled>true</a-enabled>
<isright>true</isright>
<a-description>答案1</a-description>
</answer>
<answer>
<a-enabled>true</a-enabled>
<isright>false</isright>
<a-description>答案2</a-description>
</answer>
</question>
</body>
我想在excel中进行数据输入,然后导出为xml文件,应该怎么做。
------解决方案--------------------
excel不是直接能导出为xml的么
------解决方案--------------------
使用C# 将Excel 转化为XML
using Spire.Xls;
namespace Xls2<span id="11KSFindDIV" class="KSFIND_CLASS">Xml</span>
{
class Program
{
static void Main(string[] args)
{
Workbook workbook = new Workbook();
workbook.LoadFromFile(@"..\..\test.xls");
workbook.SaveAs<span id="12KSFindDIV" class="KSFIND_CLASS">Xml</span>("sample.<span id="13KSFindDIV" class="KSFIND_CLASS">xml</span>");
}
}
}