Added XML escaping, so that the output should be well-formed XML even if the input includes '<'s, '>'s, or '&'s.
--- a/common/tools/brag/logToBRAG.pl Mon Oct 05 11:22:09 2009 +0100
+++ b/common/tools/brag/logToBRAG.pl Mon Oct 05 11:33:00 2009 +0100
@@ -133,7 +133,7 @@
$tagName =~ s{^main::}{};
if ($tagName eq "Characters")
{
- print $tree->{Text};
+ print escapeForXML($tree->{Text});
return;
}
@@ -173,3 +173,11 @@
print ">";
}
+sub escapeForXML
+{
+ $_ = shift;
+ s{&}{&}g;
+ s{<}{<}g;
+ s{>}{>}g;
+ return $_;
+}