Menu

#206 Greater than symbol not encoded in serialize

Script Library
open
nobody
TclDOM (91)
5
2011-11-18
2011-11-18
No

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 {\&lt;} value
+ regsub -all > $value {\&gt;} value

if {![string match *\"* $value]} {
append result \"$value\"

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.