Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

html.namespaces

import html

Everything here is re-exported by html, so import html is enough and the names are called as html.*. Importing html.namespaces on its own works too and reaches the same definitions.

The five namespace URIs the HTML parser deals in.

They live in a module of their own, importing nothing, because almost every other module in html needs them at load time and a shared leaf is the only arrangement that has no load order to get wrong.

html.node re-exports all of these, so node.HTML_NAMESPACE and html.HTML_NAMESPACE both work and you rarely need to name this module directly.

Constants

HTML_NAMESPACE

html.HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml'

Namespace URI of ordinary HTML elements.

SVG_NAMESPACE

html.SVG_NAMESPACE = 'http://www.w3.org/2000/svg'

Namespace URI of elements inside an <svg> subtree.

MATHML_NAMESPACE

html.MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML'

Namespace URI of elements inside a <math> subtree.

html.XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink'

Namespace URI used by the xlink: attribute prefix in SVG.

XML_NAMESPACE

html.XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace'

Namespace URI used by the xml: attribute prefix.

XMLNS_NAMESPACE

html.XMLNS_NAMESPACE = 'http://www.w3.org/2000/xmlns/'

Namespace URI used by the xmlns and xmlns:xlink attributes.


2026, Richard Ore and The Zuri Contributors