From ba3c2f39d59765bf37e7c91ba51d199e402df5ac Mon Sep 17 00:00:00 2001 From: Ben Elliston Date: Wed, 13 Sep 2017 20:10:55 +1000 Subject: * lib/framework.exp (open_logs): Set XML version to 1.1. (xml_tag): Skip valid whitespace chars (0x9, 0xA, 0xD). Include missing 'x' in escape sequence. --- ChangeLog | 6 ++++++ lib/framework.exp | 8 ++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7b3500f..7bf05cc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2017-09-13 Ben Elliston + + * lib/framework.exp (open_logs): Set XML version to 1.1. + (xml_tag): Skip valid whitespace chars (0x9, 0xA, 0xD). Include + missing 'x' in escape sequence. + 2017-08-29 Ben Elliston Revert these changes: diff --git a/lib/framework.exp b/lib/framework.exp index 20e254a..6cb93c5 100644 --- a/lib/framework.exp +++ b/lib/framework.exp @@ -65,7 +65,7 @@ proc open_logs { } { if { $xml } { catch "file delete -force -- $outdir/$tool.xml" set xml_file [open [file join $outdir $tool.xml] w] - xml_output "" + xml_output "" insertdtd xml_output "" } @@ -367,10 +367,14 @@ proc log_and_exit {} { proc xml_tag { tag body } { set escapes { < < > > & & \" " ' ' } for {set i 1} {$i < 32} {incr i} { + if {[lsearch [list 9 10 13] $i] >= 0} { + # skip valid XML whitespace chars + continue + } # Append non-printable character lappend escapes [format %c $i] # .. and then the corresponding XML escape - lappend escapes &#[format %x $i]\; + lappend escapes &#x[format %x $i]\; } return <$tag>[string map $escapes $body] } -- cgit v1.2.3