W3C home > Mailing lists > Public > html-tidy@w3.org > July to September 2000

JTidy, XHTML, xmlns, and DOCTYPE

From: Evan Lenz <elenz@xyzfind.com>
Date: Thu, 31 Aug 2000 11:09:39 -0700
To: <html-tidy@w3.org>

I'm trying to use JTidy to turn HTML into well-formed XHTML suitable for
XSLT processing.  The Linux command-line tidy -asxml worked fine for me.
JTidy, however, is not including the XHTML namespace declaration or the
XHTML DOCTYPE declaration in the output.  I believe that it's *trying* to
output XHTML, as it turns, for example, <br> into <br />.

My stylesheet is written to handle elements in the XHTML namespace, so this
is a problem (which I could get around by changing my stylesheet).  The
second problem is that Tidy does not convert &nbsp; to a numeric character
entity reference and thus must rely on the DTD to declare &nbsp;.  As I
mentioned, this works fine for tidy -asxml, but not for JTidy.

This is how I'm invoking JTidy:

        Tidy tidy = new Tidy();
        tidy.parse(in, out);

Am I leaving anything out?  Is there some option I need to change?


Evan Lenz
XYZFind Corp. "Building Better Search"
Received on Thursday, 31 August 2000 14:07:32 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:38:48 UTC