Are HTML parsers the only way to validate whether input is valid HTML? I am using Java and Nuxeo.
Asked
Active
Viewed 1,257 times
-1
-
some regex , but not perfect – zod Mar 07 '14 at 21:11
-
1HTML is not a regular language, so regex is the wrong answer to HTML validation. – Brian S Mar 07 '14 at 21:13
-
possible duplicate of [Are there any java libraries for validating user supplied HTML, on the server side?](http://stackoverflow.com/questions/2336353/are-there-any-java-libraries-for-validating-user-supplied-html-on-the-server-si) – Mike B Mar 07 '14 at 21:24
1 Answers
0
If your source is in XHTML format, you might be able to use XHTML schema to validate using Xerces or any standard dom parser. Isn't this the way the browsers validate the XHTML document?

srini.venigalla
- 5,137
- 1
- 18
- 29