views:

36

answers:

4

Are there any freely available tools that would check for things like a missing </p> or <br> (instead of <br />)?

Thanks!

+2  A: 

There is the w3c validator.

You could also use any of the many validating XML parsers to validate your XHTML against one of the XHTML DTDs (depending on which one you are using).

Oded
+1  A: 

It sounds like you are actually asking:

How can I convert HTML to XHTML?

In which case, I suggest looking at HTML Tidy or a combination of HTML::HTML5::Parser and a bit of code to output the resulting DOM as an XML document.

David Dorward
Yes, I now realize that I've lived on a desert island for almost ten years... thinking that HTML4 (and the upcoming HTML5) were supposed to be sticklers on those aspects of xHTML. I now see that <br> is expected, not <br />, while </p> and others are optional.Anyway, what option in tidy enforces xHTML? Thanks!
`--asxml` if I remember correctly
David Dorward
A: 

HTML Tidy?

JasonCoder
+1  A: 

The W3C Markup Validation Service lets you check the validity of the most commonly used web documents like html, xhtml... You can validate your code by providing a URI, File Upload or by pasting.

The Validation Service is open source so if you need a offline version you can also download the code and use it locally. (link to source code)

Florian