W3C home > Mailing lists > Public > html-tidy@w3.org > April to June 2009

JTidy to tidy migration question

From: Eugeny N Dzhurinsky <bofh@redwerk.com>
Date: Fri, 15 May 2009 16:15:46 +0300
To: html-tidy@w3.org
Message-ID: <20090515131546.GA48939@office.redwerk.com>
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 GMT

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