1
votes

We have some old legacy HTML code which we want to include in our newer XHTML Transitional web page within a content div. My question is are there any known issues in emitting standard XHTML mixed with HTML 4.0, where the DOCTYPE of the page is set to "-//W3C//DTD XHTML 1.0 Transitional//EN"?

I have tested on some browsers (even on IE10), and the output looks fine. But could there be any latent problems hidden there? Of course, no one knows what a future browsers might do, but what is the thought of this in general?

2

2 Answers

1
votes

Assuming you are serving the XHTML page as text/html, then no matter what your doctype says, you're really using HTML, not XHTML anyway, so there should be no problem embedding more HTML into it.

See http://www.hixie.ch/advocacy/xhtml and HTML 4, HTML 5, XHTML, MIME types - the definitive resource for more info.

1
votes

The only practical problem would be with validation. If a page contains a mix of HTML 4.0 and XHTML, it will create a large number of error messages when you check it with a markup validator. This makes it much more difficult to find and fix real errors that might be there, like an element not being closed or essential element nesting errors.

It would thus be better to convert the markup to something uniform. There are tools that fix legacy HTML markup to meet XHTML requirements.