[JTidy] Bug + fix: Reversed test for XHTML namespace

This is a translation bug in JTidy.  The official C version of Tidy does
not exhibit this bug.

When run with the -asxml option, 4aug2000r5 JTidy fails to fix an
incorrect XHTML namespace.  The problem in Lexer.java, fixHTMLNameSpace(),
where the last if statement has its sense backwards.  Not surprisingly,
this bug also causes JTidy to complain if the namespace is correct and to
be happy if the namespace is wrong.

Thanks,
Randy


--- Lexer.java  Fri Nov 03 18:09:12 2000
+++ \temp\Lexer.java    Fri Dec 15 17:23:31 2000
@@ -695,7 +695,7 @@

             if (attr != null)
             {
-                if (attr.value.equals(profile))
+                if (!attr.value.equals(profile))
                 {
                     Report.warning(this, node, null, Report.INCONSISTENT_NAMESPACE);
                     attr.value = new String(profile);



Be sure to use the -asxml option when trying this example:

------------------------ Example HTML document -------------------------
<html xmlns="bad-namespace">
<head><title></title></head>
<body>abc</body>
</html>
------------------------------------------------------------------------

Received on Friday, 15 December 2000 20:45:45 UTC