One way is to get rid of XPCOM for always.
So, in place of passing the HTML through memory to the nstidy.dll
- write a file: see here: https://developer.mozilla.org/en/Code_snippets/File_I%2F%2FO
- call the tidy.exe or whatever to validate
- it generates an output file
- read it
- One possible argument is to know if we need the numbers of errors or the result.
- How to implement the filter ?
- Perfomance issue ?
- Concurrency between windows ? How to handle several parallel call to the exe ? Should it be done ?