tags:

views:

53

answers:

3

If there is no DTD or schema to validate the H5 document against, how are we supposed to do document validation? And by document validation, I mean "how are we supposed to ensure our html5 documents are both syntactically accurate and structurally sound?" Please help! This is going to become a huge problem for our industry if we have no way to accurately validate HTML5 documents!

Sure, the W3C has an online tool that validates individual pages. But, if I'm creating A LOT of pages (hundreds, say) and I want to validate them in a sort of batch mode, what is the accepted method of ensuring valid structure and syntax? I mean, it seems rather rudimentary to just look at the document and say "yep. that's a valid xml document." What about custom tags? What about tag attributes? It seems like the W3C is leaving us out in the cold a little bit here.

Maybe the best answer will be found in the HTML editor. But then you get DTD/schema fragmentation. Each editor vendor coming up with their own rendition of what a valid structure is.

Maybe the answer is "wait for HTML5 to become official". But I really can't wait for that. I need to start creating and validating content now. I have applications I want to publish that can only be accomplished with html5.

So, any thoughts?

A: 

You should start by taking a look at http://about.validator.nu/ .

Some, though not all, of your concerns are addressed there. You can host your own validator, there's a python based submission script, you can use a RESTFUL web service API and there are ways to get validation output in a variety of different forms.

I can't however see a simple way to integrate XHTML5 with other applications of XML such that one can easily create a validator of such compound documents. Not that there's really been a way to do that with earlier versions of XHTML either though.

Alohci
+2  A: 

You might find this question/answer interesting: http://stackoverflow.com/questions/432933/will-html-5-validation-be-worth-the-candle . The answer is written by the developer of http://about.validator.nu/ .

kaliatech
+1  A: 

If there is no DTD or schema to validate the H5 document against, how are we supposed to do document validation?

With a specialized HTML5 validator rather then a generic SGML or XML validator.

Obviously, as the specification is still in draft form, the tools that do exist are immature and likely to be out of date or become out of date.

Sure, the W3C has an online tool that validates individual pages. But, if I'm creating A LOT of pages (hundreds, say) and I want to validate them in a sort of batch mode, what is the accepted method of ensuring valid structure and syntax?

Either use a different tool or download the W3C validator and run a local copy. It has a SOAP API so writing a batch validation tool isn't difficult.

What about custom tags?

HTML5 doesn't allow custom elements.

What about tag attributes?

The only custom attributes in HTML5 are data-* attributes, so an HTML 5 validator can recognize them.

It seems like the W3C is leaving us out in the cold a little bit here.

It seems like you expect the state of QA tools for HTML 5 (unfinished) to be up to the same standard as those for HTML 4 (over a decade old). This isn't a realistic expectation.

Maybe the best answer will be found in the HTML editor. But then you get DTD/schema fragmentation. Each editor vendor coming up with their own rendition of what a valid structure is.

The specification is clear (although in flux) even if it isn't expressed in the form of a DTD or schema. If each editor has a different idea of what is valid, then most or all of them are going to be either out of date or just buggy.

Maybe the answer is "wait for HTML5 to become official". But I really can't wait for that. I need to start creating and validating content now. I have applications I want to publish that can only be accomplished with html5.

If you need to live in the bleeding edge, then you have to accept the limitations and risks of doing so.

David Dorward