in reply to Re^4: Testing generated HTML
in thread [Solved] Testing generated HTML

I'm not particularly keen on changing the markup. I needed choroba to tell me that the tools I am using and copying (Dancer2, Template::Toolkit and Bootstrap) are producing HTML5; it's not something I could work out for myself. The purpose of my OP was to get something that would allow me to write tests based on the output of all this. To have a tool in the test framework dictate the content of the page seems to me to be a bad case of the tail wagging the dog. But I'll gladly listen to arguments that I should change.

Regards,

John Davies

Replies are listed 'Best First'.
Re^6: Testing generated HTML
by Myrddin Wyllt (Hermit) on Feb 22, 2016 at 16:35 UTC

    My post was just pointing out that you don't have to chose between HTML5 and XHTML - if you use polyglot (which is really just HTML5 with a few simple tweaks) you get valid HTML5 which can also be tested using all those useful XML modules. Anyone wanting to parse the pages you produce will also have an easier job.

    I've written a couple of Dancer2 / Template::Toolkit applications which output Polyglot HTML5 , and it's not really much more work than straight HTML; once you take into account how much more straightforward it is to write tests for XML rather than HTML, it will probably save you time in the long run

    I take your point about the tail wagging the dog, but I just think Polyglot produces 'better' output than straight HTML in any case (others may disagree) - the fact that writing tests becomes a lot easier is a consequence of this, rather than the main reason for changing.