#include <_XMLDomWrapper.au3>
Local $oXMLDoc = _XMLFileOpen(@ScriptDir & "\1.xml")
$NCount=_XMLGetNodeCount("NMenu/Computer")
For $i=1 To $NCount
$GAttrib = _XMLGetAttrib("/NMenu/Computer"&"["&$i&"]","IP" );获取属性IP的值
_XMLSetAttrib("NMenu/Computer"&"["&$i&"]", "Name", $GAttrib);设置属性Name新的值
Next
#cs 以下为1.xml的内容
<?xml version="1.0" encoding="utf-8"?>
<NMenu Version="1.0">
<Computer Name="002" MAC="8C:89:A5:CD:76:91" Flag="0008" IP="192.168.1.190" Netmask="255.255.255.0" Gateway="192.168.1.254" BootFile="boot.bin"/>
<Computer Name="003" MAC="8C:89:A5:CD:76:4D" Flag="0008" IP="192.168.1.191" Netmask="255.255.255.0" Gateway="192.168.1.254" BootFile="boot.bin"/>
</NMenu>
#ce
|