I need to validate a web page markup programmatically and I heard it’s possible by using regular expressions. If so how? Is there any other way? (Other than using w3c service)
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use HTML Tidy http://tidy.sourceforge.net/ It both reports on the validity of an HTML document, and can attempt to automatically clean it up. You can run it as a command line application and script it. There are ports or wrappers for it in Java, Perl, and Python.
I also use TagSoup library for Java http://ccil.org/~cowan/XML/tagsoup/ It does a great job of cleaning up badly formatted HTML into valid XML.