Reputation: 5876
I have html5 document and I want to check its structure against some my own definition (similiar to xml file and XML Schema). Is there a way to do that except of some ugly manual parsing? Since HTML5 is not XML-friendly (not all tags have to be closed etc.) , I can't use DTD/XML Schema (or RelaxNG which I don't know) to do that, right?
Are there any schema languages or maybe even validators (like Saxon engine...)? Javascript/jQuery implementation would be best.
Sample: - Rule: all must be inside or elements - not sure which "language" to use to describe it more formally...
invalid file:
<!doctype html> ... <div><a>Invalid Link position<a>...
valid file:
<!doctype html> ... <div><table><tr><td><a>Valid Link position<a>...
Upvotes: 2
Views: 346
Reputation: 3084
Take a look at this question,
Yet another question regarding the html5 dtd/schema
There is no schema for HTML5. A quick google search would bring up these validators,
But these require your HTML5 document to be public.
Upvotes: 1
Reputation: 3836
Some web browsers will check your page for you, if you are concerned about compatability stick with XHTML until html 5 has been wisely accepted, or a strict doctype is available for it.
Upvotes: 0