Maniek2512 Posted November 1, 2014 Share Posted November 1, 2014 Hello, firstly I'm sorry for my english I have a problem with _XMLDomWrapper I want to get all values from xml file and attribute to the variable. My .xml file: http://world.needforspeed.com/SpeedAPI/ws/game/nfsw/driver/NFSDREW/cars?shard=Apex So I want get all attributes like: $carId = carId $make = make $carName = carName $acceleration = acceleration $handling = handling $rating = rating $topSpeed = topSpeed $carClass = carClass I can do this in php but in AutoIT I have problems ;/ Link to comment Share on other sites More sharing options...
jdelaney Posted November 1, 2014 Share Posted November 1, 2014 What have you tried? Forum search XMLDOM...post some code, and someone will correct it. IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
Maniek2512 Posted November 2, 2014 Author Share Posted November 2, 2014 I do this: _SetDebug (True);show debug messages via console write #include <_XMLDomWrapper.au3> #include <Inet.au3> #include <Array.au3> #RequireAdmin ;$source = _inetgetsource("http://world.needforspeed.com/SpeedAPI/ws/game/nfsw/driver/NFSDREW/cars?shard=Apex") $Xml = "" $Xml = _XMLFileOpen("http://world.needforspeed.com/SpeedAPI/ws/game/nfsw/driver/NFSDREW/cars?shard=Apex") $count = _XMLGetNodeCount ("//list/*") Dim $aAttrName[1], $aAttrValue[1], $node for $x= 1 to $count $node = _XMLGetAllAttrib ("/list/*["&$x-1&"]",$aAttrName,$aAttrValue ) $node1 = _XMLGetAllAttrib ("/list/*["&$x-1&"]/*",$aAttrName,$aAttrValue ) _ArrayDisplay($node," worldCar Value") _ArrayDisplay($node1," physicsProfile Value") ;_ArrayDisplay($aAttrName,"Attrib Names") ;_ArrayDisplay($aAttrValue,"Attrib Value") $node = _XMLGetAttrib("/list/*["&$x-1&"]/*","name",'[@id='&$x&']') MsgBox(0,"Name Where Id="&$x,$node) if @error then ExitLoop Next Exit This works and shows me all values in array but I need to put this to table (all of them), so this should looks something like this: [car id][make][model][acceleration][handling][topspeed][rating][class] [9090][NISSAN][sILVIA (S15)][280][332][269][293][carclass_d] [3309990][AUDI][R8 4.2 FSI QUATTRO][632][374][621][542][carclass_b] etc. btw. Thanks for answer Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now