Jump to content

Novice question


Guest will4

Recommended Posts

I managed to combine two XML documents with an HTML file, but when I display the page the ending of the DTD (]>) displays first on the page before the page's content. Does this mean that the DTD is not being recognized? How do I get rid of the ]>? Is it allowed to use a DTD with HTML? The start of the XML document looks like the following.<?xml version="1.0" encoding="UTF-8" standalone="yes" ?><!DOCTYPE HTML[<!ELEMENT HTML EMPTY>. . . ]>. . . Thanks for the help

Link to comment
Share on other sites

Technically, you should be allowed to use DTDs in HTML, but the problem is browsers never really implemented HTML DTDs (except for the purpose of Doctype switching), so... no... you can't.If you use XHTML instead (as it appears you're actually doing), and serve it with an XHTML MIME type (the easiest way to do that is to change the extension from ".html" to ".xhtml"), you'll make browsers use their XML parser and XHTML rendering engine, which in turn means that you'll get support for DTDs.The problem with that is that it won't work in IE8 and below - they'll see only a download box.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...