gcue Posted March 29, 2012 Share Posted March 29, 2012 (edited) hello all. i am trying to use _XMLUpdateField to update the value for field "userInactivityTimeOut". here is the XML: <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name="lnet" type="lnet.LNetConfigHandler, lnet" /> <sectionGroup name="sing"> <section name="context" type="Sing.Context.Support.ContextHandler, Sing.Core"/> <section name="objects" type="Sing.Context.Support.DefaultSectionHandler, Sing.Core" /> </sectionGroup> </configSections> <appSettings> <add key="production" value="true"/> <add key="environments" value="prod,dev" /> <add key="environments.production" value="prod"/> <add key="ErrorMessageFile" value="cfgErrorMessageList.xml" /> <add key="logging.file" value="log.config" /> <add key="application.name" value="NETQ" /> <add key="userInactivityTimeOut" value="1440000000" /> <add key="userInactivityCheck" value="60000" /> <add key="AddTimestampToAlerts" value="true" /> </appSettings> </configuration> here is what i've tried so far (i can read the current value but stuck on trying to change it): _XMLFileOpen($file) $aNodes = _XMLGetNodeCount("/configuration/appSettings/add") for $x = 1 to $aNodes $key = _XMLGetAttrib("/configuration/appSettings/add[" & $x & "]", "key") if $key = "userInactivityTimeOut" Then $timeout = _XMLGetAttrib("/configuration/appSettings/add[" & $x & "]", "value") ConsoleWrite($timeout & @CRLF) ;neither of the following work ;_XMLUpdateField("/configuration/appSettings/add[" & $x & "]", "22") ;_XMLUpdateField("/configuration/appSettings/add[" & $x & "]/value", "22") ;_XMLUpdateField("/configuration/appSettings/add[" & $x & "]/value/key", "22") EndIf Next thanks in advance! Edited March 29, 2012 by gcue Link to comment Share on other sites More sharing options...
gcue Posted March 30, 2012 Author Share Posted March 30, 2012 this worked! (hadn't noticed this was available - was too fixated on _XMLUpdateField) _XMLSetAttrib("/configuration/appSettings/add[" & $x & "]", "value", "144000000000") 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