XHTMLTranscoder
Source Code and Documentation
Description
XHTMLTranscoder is an Open Source Java class that quickly converts broken HTML code to well-formed XHTML.
XHTMLTranscoder is a
fast transcoder useful to convert HTML code in real-time.
This class do not check headers, it checks only the general rules for tags, attributes and nesting:
- tags (elements) names in lowercase (eg: <ACRONYM> become <acronym>);
- attributes names in lowercase (eg: <acronym TITLE="example"> become <acronym title="example">);
- unquoted attributes (eg: <acronym title=example> become <acronym title="example">);
- elements nesting (eg: <b><i>hello</b></i> become <b><i>hello</i></b>);
- elements termination (eg: <p>hello world ... become <p>hello world ...</p>);
- unminimized attributes (eg: <input type="checkbox" checked /> become <input type="checkbox" checked="checked" />);
- unterminated empty tags (eg: <br> become <br />);
- preserve other languages elements (php, asp, jsp, ...)
The HTML documents transcoded using the XHTMLTranscoder class are generally recognized as valid XHTML document by the
W3C Markup Validation Service.
This project is shipped as
Eclipse project, with classes compiled into the "classes" directory.
However a packaged version of this class is available as a JAR archive inside the www directory.
To install the JAR file, just copy it on your project classpath.
Documentation and examples are included on the distribution.
Download XHTMLTranscoder from SourceForge
