I've done some searching over the past few days and I can't seem to find the right answer to this seemingly simple issue.
I just need to be able to find a particular node (there are multiples using the same name) based on an attribute in an XML file and then change one of the attributes.
Example:
So, I want to find the 'setting' node with attribute "changethis" and modify the value to "qwerty" from "12345" and then save it, keeping its current formatting. It does NOT need to pass validation, it needs to stay as is for a client application.
Again, I searched, I'm just having a helluva time with this one. Probably simple, but I'm working on many things at the same time and this one is taking too long. Plus, the answer will open up some more things I need to do in the future, so it'll be a win-win when I post some example code
Thanks in advance,
Chris
I just need to be able to find a particular node (there are multiples using the same name) based on an attribute in an XML file and then change one of the attributes.
Example:
Code:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<settings>
<setting key="dontchange" value="abcde"/>
<setting key="changethis" value="12345"/>
</settings>
</configuration>
So, I want to find the 'setting' node with attribute "changethis" and modify the value to "qwerty" from "12345" and then save it, keeping its current formatting. It does NOT need to pass validation, it needs to stay as is for a client application.
Again, I searched, I'm just having a helluva time with this one. Probably simple, but I'm working on many things at the same time and this one is taking too long. Plus, the answer will open up some more things I need to do in the future, so it'll be a win-win when I post some example code
Thanks in advance,
Chris