When a greater than symbol (>) is used within an attribute, it is not encoded into ">" when serialized. This causes an issue when the attribute is parsed in that any { or } symbols have the \ character inserted prior to them in the read string. If the > is encoded to the > character when serialized, the string is parsed and read without the escape character inserted.
The following patch fixes the problem:
--- dom.tcl 2011-11-09 06:09:45.000000000 -0600
+++ dom.tcl 2011-11-18 18:23:54.000000000 -0600
@@ -3241,6 +3241,7 @@
# Handle special characters
regsub -all & $value {\&} value
regsub -all < $value {\<} value
+ regsub -all > $value {\>} value
if {![string match *\"* $value]} {
append result \"$value\"