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
<br>
,<meta>
) self-closed (<br/>
,<meta .../>
) - ...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 to work in a Linux command line.