有一个XML文档,一个属性"pk"错了,正确是2。我们怎样把它更改正确?
原XML文档如下:
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
<?xml version="1.0" encoding="utf-8"?> <ProcessSorts> <ProcessSort pk="0"> <ProcessSortName>直接工序</ProcessSortName> </ProcessSort> <ProcessSort pk="1"> <ProcessSortName>间接工序1</ProcessSortName> </ProcessSort> <ProcessSort pk="7"> <ProcessSortName>间接工序2</ProcessSortName> </ProcessSort> <ProcessSort pk="3"> <ProcessSortName>间接工序3</ProcessSortName> </ProcessSort> <ProcessSort pk="4"> <ProcessSortName>间接工序4</ProcessSortName> </ProcessSort> </ProcessSorts>
下面Insus.NET使用asp.net程序来更新它,先引用几个namespace:
using System.Xml; using System.Xml.Linq; using System.Xml.XPath;