Jump to content

_XMLDomWrapper assistance


Recommended Posts

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:

Posted Image

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

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

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 by arch0nmyc0n
Link to comment
Share on other sites

  • 1 month later...

$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 above

oh, and just for general XML information, w3schools is great:http://www.w3schools.com/xml/

Edited 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...