Is there an easy way in C# to validate an html file (.htm) ?
Asked
Active
Viewed 4,403 times
3
-
you can use an online validator? http://validator.w3.org/ – zapping Feb 02 '10 at 09:30
-
nope, it's a closed environment (BizTalk) – Patrick Peters Feb 02 '10 at 12:02
1 Answers
2
You could try the article C# Validate XHTML on Dot Net Perls.
If you are not tied to doing this in C#, then usually the best way to validate HTML is using the W3C validation service.
You could of course, write some kind of test harness in C# which pushes all your HTML through the W3C validator, if it makes sense in your case.

Adam Ralph
- 29,453
- 4
- 60
- 67
-
@PatrickPeters: Be aware that (at least according to the title) that's just for XHTML, not HTML. – O. R. Mapper Jan 20 '13 at 21:04