Re: [html-tidy] <none>

David --

Okay, I see what you mean now.

First of all, I set up Tidy on my own by just extracting everything from
the zip file and that seemed to work just fine.  I think your
installation is working fine also.

The problem is that the example that you're using, 'code example of
using Java Tidy as a parser' from the JTidy page, has the following line
in it:

	tidy.setXmlTags(true);

This means that the _input_ is XML so that is what Tidy is expecting. 
However, your input is HTML, not XML.  Either comment out or delete the
line and you'll see much better results.  You'll get a lot more errors
but they'll be legitimate errors in your page.

You might also try substituting the line

	tidy.setXHTML(true);

This tells Tidy to _output_ XHTML although I'm not sure what effect that
has when your using the pretty printer in the TestDOM class in the
example rather than the built-in one inside Tidy.  To use that one, and
bypass all of this other coding, change

	t.print(tidy.parseDOM(in, null));

to

	tidy.parseDOM(in, System.out);

HTH,
Gary

David Rennie Hinshelwood wrote:
> 
> The web page is www.crl.nmsu.edu but I've created web pages with FrontPage
> and Word and with a text editor and I get to same results so I think it must
> be my setup if you don't have the same problems. Did you have any trouble
> setting up JTidy with the batch file or do you run Unix?
> 
> David Hinshelwood
> CRL NMSU
> Tel: (505) 646 3342 (office)
>        (505) 645 5537 (home)
> 
> -----Original Message-----
> From: Gary L Peskin [mailto:garyp@firstech.com]
> Sent: Wednesday, July 05, 2000 12:47 PM
> To: David Rennie Hinshelwood
> Cc: 'Html-Tidy
> Subject: Re: [html-tidy] <none>
> 
> David --
> 
> It's a little hard from your email to determine exactly what your
> configuration looks like.  Basically, all you should need to actually
> run JTidy, I think, is the Tidy.jar file which is included in the
> distribution.  Make sure that it is specified in your CLASSPATH.
> 
> Can you send me privately the URL or the actual text of a web page that
> is giving you these "unexpected </head> ..." messages.  I'll run it here
> and see if I have the same problem.  We can go from there and determine
> if the problem is in JTidy or your setup.
> 
> Gary
> 
> David Rennie Hinshelwood wrote:
> >
> > Hi,
> >
> > I'm trying to use JTidy to convert HTML to XHTML. I had trouble installing
> > JTidy and had to change the batch file to complete the install (I've
> > attached my updated version). When I run the test program from the JTidy
> > website, 'code example of using Java Tidy as a parser', on any web page it
> > spits back 6/7 errors and real bad HTML code. The worst error I get is
> > 'unexpected </head> tag in <meta> tag'. This is the cause of the garbage
> > HTML created by JTidy.
> > I think either the install went wrong or my config settings are wrong.
> > During the install, the .properties file wasn't created so I just copied
> it
> > from the download. I havnen't changed the config settings since install.
> > Could you please send me some suggestions as to how to get it working.
> > Thanks
> >
> > David Hinshelwood
> > CRL NMSU
> > Tel: (505) 646 3342 (office)
> >        (505) 645 5537 (home)

Received on Wednesday, 5 July 2000 20:28:52 UTC