JTidy to tidy migration question

Hello there!

Can somebody please advice, what is the best way to achieve the same results
of the conversion of the HTML documents to XHTML Strict as the following Java
code does:

final Tidy tidy = new Tidy();
tidy.setXHTML(true);
tidy.setDocType("strict");
tidy.setXmlOut(true);
tidy.setQuiet(true);
tidy.setEncloseText(true);
tidy.setFixBackslash(true);
tidy.setFixComments(true);
tidy.setHideEndTags(true);
tidy.setMakeClean(true);
tidy.setErrout(pwErr);
tidy.setCharEncoding(Configuration.UTF8);
tidy.setTidyMark(false);
tidy.setSmartIndent(true);
tidy.setSpaces(1);
tidy.setWraplen(80);
tidy.setWord2000(true);
tidy.setWrapSection(true);
tidy.setLogicalEmphasis(true);

We tried to do the same thing with the following settings in the configuration file,
passed to the tidy - but with no luck.

output-xhtml: yes
add-xml-decl: yes
doctype: strict
input-encoding: utf8
output-encoding: utf8
indent: no
wrap-section: no
force-output: yes
markup: yes
indent: no
break-before-br: yes
show-errors: 0
word-2000: yes
repeated-attributes: keep-last
quiet: yes
tidy-mark: no
drop-font-tags: yes
drop-proprietary-attributes: yes
drop-empty-paras: yes
bare: yes
clean: yes
logical-emphasis: yes
quote-marks: yes
enclose-text: yes
enclose-block-text: yes
literal-attributes: yes
join-classes: yes

The produced document looks different - the inline styles are moved to the document
head, the CDATA sections wraps the code within the <script> tags and so on.

So are these libraries interchangeable among self? Is it possible to safely
replace the JTidy with native Tidy and visa versa with getting the same
conversion results for same documents?

Thank you in advance!

-- 
Best regards
Eugene Dzhurinsky

Received on Friday, 15 May 2009 13:16:30 UTC