jfisteus/html2xhtml — pull request #1 by avium (2011-12-10 01:51:46+00:00)
Title: Generating a snippet

I had a situation where I needed to translate snippets of HTML to valid XHTML, so I made a couple of minor modifications to your code so that one can optionally print the contents of the

tag, minus the XML declaration, prolog, HTML tags, HEAD node, and BODY tags.

I imagine the general public may find this functionality useful for AJAX services, which very often dump an HTML snippet back into the DOM after an AJAX request returns a response.

Ideally - in addition to generating snippets - html2xhtml would be able to correctly parse them, too. Based on my (admittedly limited) testing, it couldn't do this.