From: Sean V. B. <sv...@gm...> - 2009-09-15 06:52:22
|
Hi all, Firstly, as my first post, I'd like to say a big hello, and thank you to the developers for this fine product. Secondly, sorry if this is a duplicate. But I assumed my first post didn't work, as I didn't get the confirmation email I expected (according to configurations). In the case you haven't already heard from me, please read on! I am of course trying to clean up the dodgy html that i'm producing with a java html editor i'm using. My html is actually generated and inserted into the java editor. When in the java editor, at various points in time, it needs to be cleaned by JTidy so that it still is xhtml compliant (no missing end tags, etc). However, after going through JTidy (using the Fri Jul 31 2009 23:53 snapshot/release), with the following setings (see below), my head element gets stripped, and my style element goes missing. Given my settings below, and the reason I'm using JTidy (ensure there are always end tags) what am I doing wrong (or is it my assumptions that are wrong?) and how can I fix it? Thanks to all replies. p.s Here is my JTidy code: public void cleanHTML(InputStream input, OutputStream output) { Tidy tidy = new Tidy(); tidy.setXHTML(true); tidy.setDocType("strict"); tidy.setMakeClean(true); tidy.setQuiet(false); tidy.setIndentContent(true); tidy.setSmartIndent(true); tidy.setDropEmptyParas(false); tidy.setFixBackslash(true); tidy.setForceOutput(true); tidy.setTrimEmptyElements(false); tidy.setHideEndTags(true); tidy.setIndentAttributes(true); tidy.setBreakBeforeBR(true); tidy.setFixComments(true); tidy.setLogicalEmphasis(true); // b to strong etc tidy.setDropFontTags(false); tidy.setOutputEncoding("UTF-8"); tidy.parseDOM(input, output); } |