arch0nmyc0n Posted May 5, 2012 Share Posted May 5, 2012 I've been working with this UDF on and off over the last few weekends, but I've not gotten any futher with it. I just can't wrap my mind around it (pun intended). Seriously though, I think I'm just not grasping the terminology properly.All I'm trying to do is change a value:I just want to change SelectLastPlayedWorld to True.I've tried a couple of things, but I'm not even coming close. Can anyone give me a hand with this? Or at least tell me which command I need to use? Link to comment Share on other sites More sharing options...
arch0nmyc0n Posted May 6, 2012 Author Share Posted May 6, 2012 Okay so I've been looking into it a bit more this morning. From the picture provided UserSettings is the Root Node and LauncherOptions is a child node that would be included in the strXPath variable. Right? Now I think this is where I get confused. I'm not sure what option is. Is it another node to be used in the strXPath? And then what is value? Is it an element? an attribute? field?Reading a few more pages, Option appears to be an element? and value is a Namespace? Link to comment Share on other sites More sharing options...
arch0nmyc0n Posted May 7, 2012 Author Share Posted May 7, 2012 (edited) Okay so after doing some further digging and speaking to a few more knowledgable people, Option is a node which would therefore be a part of the XPath, while Value is an attribute. So if thi is the case I'd be using the _XMLSetAttrib. However, since there are multiple "lines" with two attributes, how do I set the "SelectLastWorldPlayed" to True? Is it considered an array so I'd specify a specific index of some kind? Edited May 7, 2012 by arch0nmyc0n Link to comment Share on other sites More sharing options...
arch0nmyc0n Posted June 10, 2012 Author Share Posted June 10, 2012 I thought I'd come back and mention I gave up trying to use the XML wrapper and just used _FileReadToArray to load the XML file, searched for and changed the line I needed to change and used _FileWriteFromArray to make the change. Link to comment Share on other sites More sharing options...
jdelaney Posted June 11, 2012 Share Posted June 11, 2012 (edited) $oXML=ObjCreate("Microsoft.XMLDOM") $oXML.Load($XMLFileAndDir) ConsoleWrite ( $oXML.xml & @CRLF) $result = $oXML.selectNodes('//LauncherOptions/options[@key="SelectLastPlayedWorld]/@value' ) For $Node In $result $Node.value = "True" Next ConsoleWrite ( $oXML.xml & @CRLF)try the aboveoh, and just for general XML information, w3schools is great:http://www.w3schools.com/xml/ Edited June 11, 2012 by jdelaney 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...
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