You are very close. According to your first post, you are trying to change the text of the <value> node of the <setting> node that has a "name" attribute equal to "SubprocessNotAllowed". Your xpath correctly selects the <setting> node. However, the node you want to modify is the child <value>.
The example script below is one way that it could be done. Note that I used the .SelectSingleNode method because there should be only one matching node. Using .selectSingleNode removes the need to do a FOR loop on what is ultimately a single node.
Example script:
#AutoIt3Wrapper_AU3Check_Parameters=-w 3 -w 4 -w 5 -w 6 -d
#include <Constants.au3>
xml_example()
Func xml_example()
Local $oComErr = ObjEvent("AutoIt.Error", "com_error_handler")
#forceref $oComErr
Local $oValueNode = Null
With ObjCreate("Msxml2.DOMDocument.6.0")
;Load XML document
.PreserveWhitespace = False
.load(@ScriptDir & "\ProcessControl.dll.config")
If .parseError.errorCode Then Exit MsgBox($MB_ICONERROR + $MB_TOPMOST, "XML PARSING ERROR", .parseError.reason)
;Select node of interest
$oValueNode = .selectSingleNode('//setting[@name="SubprocessNotAllowed"]/value')
If Not IsObj($oValueNode) Then Exit MsgBox($MB_ICONERROR, "Error", "Value node not found.")
;Display XML before change (parent node is displayed for context)
ConsoleWrite("Value Before" & @CRLF)
ConsoleWrite($oValueNode.selectSingleNode('..').xml & @CRLF) ;parent node
;Modify text of "value" node
$oValueNode.text = "some,new,value"
;Display XML after change (parent node is displayed for context)
ConsoleWrite(@CRLF & "Value After" & @CRLF)
ConsoleWrite($oValueNode.selectSingleNode('..').xml & @CRLF) ;parent node
;~ ;Save new file
;~ .Save(@ScriptDir & "\New.ProcessControl.dll.config")
EndWith
EndFunc
Func com_error_handler($oError)
With $oError
ConsoleWrite(@CRLF & "COM ERROR DETECTED!" & @CRLF)
ConsoleWrite(" Error ScriptLine....... " & .scriptline & @CRLF)
ConsoleWrite(" Error Number........... " & StringFormat("0x%08x (%i)", .number, .number) & @CRLF)
ConsoleWrite(" Error WinDescription... " & StringStripWS(.windescription, $STR_STRIPTRAILING) & @CRLF)
ConsoleWrite(" Error RetCode.......... " & StringFormat("0x%08x (%i)", .retcode, .retcode) & @CRLF)
ConsoleWrite(" Error Description...... " & StringStripWS(.description , $STR_STRIPTRAILING) & @CRLF)
EndWith
Exit
EndFunc
Console output:
Value Before
<setting name="SubprocessNotAllowed" serializeAs="String">
<value>MPWB,MPCL,HDLT,ARLT,MTOG,PDCP</value>
</setting>
Value After
<setting name="SubprocessNotAllowed" serializeAs="String">
<value>some,new,value</value>
</setting>