First of all, I steered you wrong in the first place. Instead of set line [string map {$searchWord $replaceWord} $line], you should use set line [string map "$searchWord $replaceWord" $line]. The curly braces delay the necessary substitution.
The -1 returned from the "string first" statement means that the search pattern was not found. In the case you list, it means the searchWord = "<edgetime>8:00</edgetime>" was not in the string, "line".
So, as I alluded previously, let's say you're going through the lines in your XML file, one by one, and you want to look for a particular tag. In your example it's "<edgetime>" but I don't want to type that anymore so let's say it's "<tag>". We'll start from the point where the XML string is the value of "line". We'll use "regexp" to get the value that follows <tag> into a variable:
regexp {(\<tag\>)([0-9]*:[0-9]*)} $line m1 m2 m3
now the variable, m1, contains "<tag>nn:nn"; m2 contains "<tag>"; and m3 contains "nn:nn" (where nn:nn is some number of digits followed by a comma followed by some number of digits).
Now manipulate $m3:
[/b]
set mlst [split $m3 :][/b]
#add 30 minutes
set mlst [lreplace $mlst 1 1 [expr [lindex $mlst 1]+30]]
#add 1 hour
set mlst [lreplace $mlst 0 0 [expr [lindex $mlst 0]+1]]
#join them back up:
set m4 [join $mlst :]
#now use regsub to replace the string:
regsub {\<tag\>[0-9]*:[0-9]*} $line "\<tag\>$m4" line
Bob Rashkin
rrashkin@csc.com