Namspaces?

Hi I’m curious for some reason to know the different namespaces for HTML. I think for XHTML they just have 1.1 and 1.0 but what about for just HTML? I never really bothered looking into it before since dreamweaver would just already have it set. thanks for any info.

Do you mean DTD instead?

it comes after the doctype.

XHTML uses XML namespace but HTML 4.01 doesn’t. For XHTML 1.x the root element of the document must contain an xmlns declaration. The typical default namespace for the vanilla XHTML 1.0 is as follows: [FONT=Courier New]

<html xmlns=“http://www.w3.org/1999/xhtml”>[/FONT]

That is the most common you will see in most websites written using XHTML grammar.

In that case, I agree with Robert. In order to use namespaces in web dev, you have to use XML or XHTML, “just HTML” doesn’t support this feature.

You use namespaces in XHTML mainly for SVG, MathML, X3D etcetera integration in web documents, and then to “subclass” your own elements based on standard XHTML elements, or make some new ones in your own namespace, ideally also providing a DTD.

Yeah, but that’s too general. :slight_smile:
Everything comes after the doctype, except XML declaration:
<?xml version=“1.0” encoding=“UTF-8” ?>

You can declare namespaces as attributes for the root element of the web document:

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:svg="http://www.w3.org/2000/svg">

or inside your web document:

<html xmlns="http://www.w3.org/1999/xhtml">
<head><body>
[...]
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<rect x="0" y="0" width="100" height="100" />
</svg>

So, namespaces in web dev pretty much tells us that the web document it’s using elements outside the scope of its own DTD.