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>
Message-ID: <BNEMICIEADHDDOIKLHNCGEIICDAA.elenz@xyzfind.com>

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.setXmlOut(true);
        tidy.parse(in, out);

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

Thanks,

Evan Lenz
elenz@xyzfind.com
http://www.xyzfind.com
XYZFind Corp. "Building Better Search"
Received on Thursday, 31 August 2000 14:07:32 GMT

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