XHTMLTranscoder
XHTMLTranscoder is an Open Source PHP5 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, ...)
Documentation and examples are included on the distribution.
Download XHTMLTranscoder from SourceForge