This is the mail archive of the mailing list for the Mauve project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

fix/workaround for java.util.regex.Pattern.pcrematches' XML output


This patch filters a character in the output from
java.util.regex.Pattern.pcrematches which is not a valid character in
XML files:

$ xmllint zzz.xml 
zzz.xml:354: parser error : PCDATA invalid Char value 11
    <pass>  line 138: a
                       b [1]</pass>

I simply replace it with '?'.  It's not the best solution, because '?'
is a commonly used character in regular expressions, but it works.

I'll commit that one as I think nobody cares about the XML output

- twisti


Index: gnu/testlet/
RCS file: /cvs/mauve/mauve/gnu/testlet/,v
retrieving revision 1.3
diff -u -3 -p -r1.3
--- gnu/testlet/ 19 Jun 2006 22:07:37 -0000      1.3
+++ gnu/testlet/ 19 May 2008 07:44:59 -0000
@@ -124,6 +124,8 @@ public class TestReport
     str = str.replaceAll("&", "&amp;");
     str = str.replaceAll("<", "&lt;");
     str = str.replaceAll(">", "&gt;");
+    // This is a workaround for java.util.regex.Pattern.pcrematches.
+    str = str.replace('
                        ', '?');
     return str;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]