我在我的应用程序添加功能元素的名称,其中一个DataTable
转换成XML
,就像这样:Datatable.WriteXml - 如何保持空格
dtResults.WriteXml(fileName);
_x0020_
被加入,而不是空间内的输出XML文档。
是否有可能在没有_x0020_
的代码的情况下生成XML文件?即可以使用该方法或类似方法生成XML文件,并且实际上保留了空格?
这是在DataGrid:
这是生成的XML:
<Customers>
<Customer_x0020_Name>Sean</Customer_x0020_Name>
</Customers>
<Customers>
<Customer_x0020_Name>John</Customer_x0020_Name>
</Customers>
<Customers>
<Customer_x0020_Name>Sarah</Customer_x0020_Name>
</Customers>
<Customers>
<Customer_x0020_Name>Mark</Customer_x0020_Name>
</Customers>
<Customers>
<Customer_x0020_Name>Norman</Customer_x0020_Name>
</Customers>
20是空间的十六进制值。请根据你的意思更具体。 – 2013-02-18 20:11:11
我想要在XML文件中生成空格,而不是空格的十六进制代码。它甚至有可能吗? – 2013-02-18 20:13:21
你能展示一个正在输出的XML的例子吗?你在哪里看到十六进制数字? – 2013-02-18 20:14:45