XHTMLforward

A little tool for reformatting XHTML, as generated by XML tools like XSLT processors, to make it work in browsers that do not handle XML properly. More specifically:

Inserts a space before the closing slash in any empty-element shorthand tag declared EMPTY in the HTML specifications, so that:

<img src="popotan.jpg" alt="Puni puni ha petan!"/> <hr/>

is rewritten to:

<img src="popotan.jpg" alt="Puni puni ha petan!" /> <hr />

This is needed because older browsers might otherwise treat the closing slash as part of the element name or attribute value.

Rewrites any other empty-element shorthand tag to a start-tag immediately followed by an end-tag, so that:

<script type="text/javascript" src="sidebar.js"/>

is rewritten to:

<script type="text/javascript" src="sidebar.js"></script>

This is needed because Internet Explorer fails to render the page when an empty shorthand script tag is used in the header. Safari does not understand empty shorthand anchor tags.

It can be used from the command line or as a Python extension module. Some documentation is included in the source.

Download XHTMLforward

Note: If you were looking at this page in a more modern browser like Mozilla Firefox or Safari, it would look and work better and faster.
Find out more…