-1

Are HTML parsers the only way to validate whether input is valid HTML? I am using Java and Nuxeo.

TylerH
  • 20,799
  • 66
  • 75
  • 101
zod
  • 12,092
  • 24
  • 70
  • 106
  • some regex , but not perfect – zod Mar 07 '14 at 21:11
  • 1
    HTML 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 Answers1

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