I am looking for a tool which can fix XML documents, particularly HTML documents. (Well I know HTML is not XML, but is very close to it - in essence, we could consider HTML/HTML5 as an XML-like document format with far lesser constraints.)
On the fix, I am thinking on such transformations:
- making not closed tags closed (intuitively, by finding a good place for the closing tags)
- making standalone HTML tags (like
<meta>) self-closed (
- ...and any similar, which is needed to convert a text file to a valid XML document.
The goal is the ability to process HTML5 documents by XML stylesheets.
Best option would be if it could be made working in a Linux command line.