#include <Array.au3>
#include <_XMLDomWrapper.au3>
Local $XMLFile = @ScriptDir & "\test.xml"
If Not FileExists($XMLFile) Then
CreatXMLFile()
EndIf
Local $oXMLDoc = _XMLFileOpen($XMLFile) ;打开讯录文件
If @error Then
MsgBox(16, "提示", "打开文件发生错误,代码:" & @error)
Exit
EndIf
ReadData()
Func CreatXMLFile()
$YN = MsgBox(1, "提示", "找不到通讯录文件txl.xml,是否要制作?")
If $YN = 1 Then
;_XMLCreateFile($XMLFile, "Addressbook", True);因不支持中文,弃用
FileWrite($XMLFile, '<?xml version="1.0" encoding="gb2312"?>' & @CRLF & '<Addressbook/>')
Else
Exit
EndIf
EndFunc ;==>CreatXMLFile
Func ReadData()
$nodeCount = _XMLGetNodeCount('taobaoke_items_get_response/taobaoke_items/taobaoke_item')
;$rel=_XMLGetAttrib('taobaoke_items_get_response/taobaoke_items/taobaoke_item[1]', "Relation")
$click_url = _XMLGetValue("taobaoke_items_get_response/taobaoke_items/taobaoke_item[1]/commission")
;$click_url = _XMLGetAttrib("/Addressbook/Linkman[" & $i & "]", "Relation")
MsgBox(0, '', $click_url)
Exit
EndFunc ;==>ReadData
|