XML为什么解析不出来?哪里有错?
#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', "Relation")
$click_url = _XMLGetValue("taobaoke_items_get_response/taobaoke_items/taobaoke_item/commission")
;$click_url = _XMLGetAttrib("/Addressbook/Linkman[" & $i & "]", "Relation")
MsgBox(0, '', $click_url)
Exit
EndFunc ;==>ReadData XML文件
http://115.com/file/bengee25#test.xml 知道了 少了个/
页:
[1]