Bill said:
Okay. I think XHTML may take over HTML myself but if I wanted to write an
XHTML page do I need this
<?xml version="1.0"?>
Or would the begining tage be
<html xmlns="
www.w3.org/1999/xhtml"> ?
Bill
<?xml version="1.0" encoding="your-encoding-here"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML MyXHTMLVersion//EN"
"URI-of-that-DTD">
<html xmlns="
http://www.w3.org/1999/xhtml">
would be the correct beginning of an XHTML file.
The correct beginning of an HTML file would be
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML MyHTMLVersion//EN"
"URI-of-that-DTD">
<html>
The Doctypes can be found at
http://www.w3.org and via most search
engines ("HTML Doctype DTD" should turn up some results).
The XML Processing instruction (PI) may be dropped when using XHTML, but
it is mandatory for standards compliant XML. The Doctype header is
mandatory for valid (X)HTML (no validity without a DTD) and the XML
Namespace is mandatory for validity in XHTML as the DTD specifies it as
a mandatory attribute. Also note that all URIs have to be written
exactly the same way they are written in the standards.
"
http://www.w3.org/1999/xhtml", "
http://w3.org/1999/xhtml",
"
www.w3.org/1999/xhtml", "
HTTP://W3.ORG/1999/xhtml" and
"//w3.org/1999/xhtml" are all different namespaces and only the first
one is the correct namespace for XHTML.
Also note that the DTDs need to be complete (i.e. both the PUBLIC
identifier (that string with the -//W3C// etc) and the SYSTEM identifier
(the URI of the DTD) need to be specified).
Don't understand? Read a tutorial. Search engines might help.
-ap