12.4.1 XML Namespaces

This module has support for XML namespaces as defined in the XML Namespaces proposed recommendation.

Tag and attribute names that are defined in an XML namespace are handled as if the name of the tag or element consisted of the namespace (i.e. the URL that defines the namespace) followed by a space and the name of the tag or attribute. For instance, the tag <html xmlns='http://www.w3.org/TR/REC-html40'> is treated as if the tag name was 'http://www.w3.org/TR/REC-html40 html', and the tag <html:a href='http://frob.com'> inside the above mentioned element is treated as if the tag name were 'http://www.w3.org/TR/REC-html40 a' and the attribute name as if it were 'http://www.w3.org/TR/REC-html40 src'.

An older draft of the XML Namespaces proposal is also recognized, but triggers a warning.


Send comments on this document to python-docs@python.org.