W3C home > Mailing lists > Public > html-tidy@w3.org > October to December 2000

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

From: Randy Waki <rwaki@flipdog.com>
Date: Fri, 15 Dec 2000 18:42:39 -0700
To: <html-tidy@w3.org>
Message-ID: <001f01c06701$791b62c0$b665a8c0@rwaki>
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.


--- 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">
Received on Friday, 15 December 2000 20:45:45 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 3 April 2012 06:13:44 GMT