C#根据XML中一个节点值更改另一个节点的值
<?xmlversion="1.0"encoding="utf-8"?><Delivery><Appearance><Manufacturing>A12093039-5<...
<?xml version="1.0" encoding="utf-8"?>
<Delivery>
<Appearance>
<Manufacturing>A12093039-5</Manufacturing>
<Weight>4702.5</Weight>
<Waybill>3000</Waybill>
<Diameter>15.20</Diameter>
</Appearance>
<Appearance>
<Manufacturing>A12093039-6</Manufacturing>
<Weight>4702.5</Weight>
<Waybill>3000</Waybill>
<Diameter>15.20</Diameter>
</Appearance>
<Appearance>
<Manufacturing>A12093039-4</Manufacturing>
<Weight>4702.5</Weight>
<Waybill>3000</Waybill>
<Diameter>15.20</Diameter>
</Appearance>
<Appearance>
<Manufacturing>A12093039-2</Manufacturing>
<Weight>4702.5</Weight>
<Waybill>3000</Waybill>
<Diameter>15.21</Diameter>
</Appearance>
<Appearance>
<Manufacturing>A12093039-3</Manufacturing>
<Weight>4702.5</Weight>
<Waybill>3000</Waybill>
<Diameter>15.21</Diameter>
</Appearance>
</Delivery>
在这个XML中,我想只修改Diameter的值为15.21的Appearance节点中的Weight的值,有没有高手教教我怎么写代码?我是一个刚接触XML的菜鸟,希望各位大大写的越详细越好。感激不尽! 展开
<Delivery>
<Appearance>
<Manufacturing>A12093039-5</Manufacturing>
<Weight>4702.5</Weight>
<Waybill>3000</Waybill>
<Diameter>15.20</Diameter>
</Appearance>
<Appearance>
<Manufacturing>A12093039-6</Manufacturing>
<Weight>4702.5</Weight>
<Waybill>3000</Waybill>
<Diameter>15.20</Diameter>
</Appearance>
<Appearance>
<Manufacturing>A12093039-4</Manufacturing>
<Weight>4702.5</Weight>
<Waybill>3000</Waybill>
<Diameter>15.20</Diameter>
</Appearance>
<Appearance>
<Manufacturing>A12093039-2</Manufacturing>
<Weight>4702.5</Weight>
<Waybill>3000</Waybill>
<Diameter>15.21</Diameter>
</Appearance>
<Appearance>
<Manufacturing>A12093039-3</Manufacturing>
<Weight>4702.5</Weight>
<Waybill>3000</Waybill>
<Diameter>15.21</Diameter>
</Appearance>
</Delivery>
在这个XML中,我想只修改Diameter的值为15.21的Appearance节点中的Weight的值,有没有高手教教我怎么写代码?我是一个刚接触XML的菜鸟,希望各位大大写的越详细越好。感激不尽! 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询