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

Christian Thalinger twisti@complang.tuwien.ac.at
Mon May 19 07:51:00 GMT 2008


Hi!

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
anyways.

- twisti

---

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




More information about the Mauve-patches mailing list