View Single Post
  #3  
Old 10-25-2006, 01:28 PM
jabaran jabaran is online now
Registered User
 
Join Date: 10-23-2006
Posts: 3
My solution

I ended up with a script that looked like list....

' script to update value attributes in a .NET config file
' requires MSXML v3.0+ to be installed --
' http://msdn.microsoft.com/library/de...xmlgeneral.asp

' load the settings xml document
Set msxml = CreateObject("MSXML2.DOMDocument")
msxml.async = False
msxml.load "%XML_FILE%"

Set root = msxml.documentElement
if root is nothing then
set root = msxml.createElement("Builds")
msxml.appendChild(root)
end if

'Get the node that contains the information about the last build
Set lastBuild = root.lastChild
if not (lastBuild is nothing) then
call lastbuild.setAttribute("NextBuildDate", "%Date%")
set buildNo = lastBuild.getAttributeNode("BuildNo")
if buildNo is nothing then
buildNo = -1
else
buildNo = buildNo.value + 1
end if
else
buildNo = 0
end if

'Create a new Release
Set thisRelease=msxml.createElement("Build")
call thisRelease.setAttribute("BuildNo", buildNo)
call thisRelease.setAttribute("BuildDate", "%dateTime%")
'Next build hasn't happened... set it off in the future... way off into the future...

call thisRelease.setAttribute("NextBuildDate", "12/31/9999")

'Append the new Release
root.appendChild(thisRelease)
' save the changes back out
msxml.save "%XML_FILE%"

The XML ends up looking like...
<Builds>
<Build BuildNo="1" BuildDate="10/25/2006 2:26:54 PM" NextBuildDate="12/31/9999">
</Builds>

Maybe someone will find this useful...
Reply With Quote