Jump to content

Dtd


ckrudelux
 Share

Recommended Posts

Hi got an intressting problem started to do validation on my page and got an error that seems to trigger that allmost every code gets an error.<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">when I do a validation it says that I need add a code to my <html>"Missing xmlns attribute for element html"I don't have xml code in my page and w3schools says noting about having extra codes in the <html>I have links to rss doc in my head but.. I tested making a new page with just the some simple code lines to see if it gets away.anyone knows what to do about it?

Link to comment
Share on other sites

Okay half of my errors got away but that does that code line do?
<html xmlns="http://www.w3.org/1999/xhtml" lang="en_US" xml:lang="en_US">It has a function similar to that of <!DOCTYPE>, the doctype describes the html type, but the xmlns="http://www.w3.org/1999/xhtml" lang="en_US" xml:lang="en_US" says what type of xml and xhtml.
Link to comment
Share on other sites

<html xmlns="http://www.w3.org/1999/xhtml" lang="en_US" xml:lang="en_US">It has a function similar to that of <!DOCTYPE>, the doctype describes the html type, but the xmlns="http://www.w3.org/1999/xhtml" lang="en_US" xml:lang="en_US" says what type of xml and xhtml.
thanks for the help :)
Link to comment
Share on other sites

Three corrections (just to make sure you got things straight):1. It's actually "en-us", not "en_US". Also, the lang and xml:lang attributes are optional. You should indeed include them though, as it's useful for screen readers and search engines.2. The DTD itself only tells what is valid in the XML. The public identifier is supposed to say what kind of a document this is, but for various reasons (namely - the ability to mix the contents of one XML into another) it's not reliable, and is never really used.3. Namespaces tell what kind of an XML document this is, i.e. they take on the function of the public identifier on the DTD. Unlike them, they are more reliable, because they can be specified on any level of the X(HT)ML document, thereby allowing the mixture of documents scenario mentioned above. In true XHTML (i.e. served with the application/xhtml+xml MIME type), as well as XML parsers (e.g. PHP), they are imporant and are used. In XHTML as text/html, they are ignored just like the DTD.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...