假设我得到了这个xml文件:
<xml>
<Attribute name="attribute1">
<Value1>True</Value1>
<Value2>True</Value2>
<ID>1</ID>
</Attribute>
<Attribute name="attribute2">
<Value1>True</Value1>
<Value2>True</Value2>
<ID>2</ID>
</Attribute>
<Attribute name="attribute3">
<Value1>True</Value1>
<Value2>True</Value2>
<ID>3</ID>
</Attribute>
</xml>
我想做的是:
获取“名称”属性的值(为此,我使用sel -t -m "xml" -m "Attribute" -v "@name"
)
使用检索到的值并更新节点的相应ID元素,使结果显示为例如attribute1 <ID>attribute1</ID>
使用XmlStarled可以吗?