<!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.0 Transitional//EN">
<link rel=
"STYLESHEET" href=
"lib.css" type='text/css'
/>
<link rel=
"SHORTCUT ICON" href=
"../icons/pyfav.png" type=
"image/png" />
<link rel='start' href='../index.html' title='Python Documentation Index'
/>
<link rel=
"first" href=
"lib.html" title='Python Library Reference'
/>
<link rel='contents' href='contents.html'
title=
"Contents" />
<link rel='index' href='genindex.html' title='Index'
/>
<link rel='last' href='about.html' title='About this document...'
/>
<link rel='help' href='about.html' title='About this document...'
/>
<link rel=
"next" href=
"node652.html" />
<link rel=
"prev" href=
"module-xml.dom.html" />
<link rel=
"parent" href=
"module-xml.dom.html" />
<link rel=
"next" href=
"node652.html" />
<meta name='aesop' content='information'
/>
<title>13.6.1 Module Contents
</title>
<div id='top-navigation-panel' xml:id='top-navigation-panel'
>
<table align=
"center" width=
"100%" cellpadding=
"0" cellspacing=
"2">
<td class='online-navigation'
><a rel=
"prev" title=
"13.6 xml.dom "
href=
"module-xml.dom.html"><img src='../icons/previous.png'
border='
0' height='
32' alt='Previous Page' width='
32'
/></A></td>
<td class='online-navigation'
><a rel=
"parent" title=
"13.6 xml.dom "
href=
"module-xml.dom.html"><img src='../icons/up.png'
border='
0' height='
32' alt='Up One Level' width='
32'
/></A></td>
<td class='online-navigation'
><a rel=
"next" title=
"13.6.2 Objects in the"
href=
"node652.html"><img src='../icons/next.png'
border='
0' height='
32' alt='Next Page' width='
32'
/></A></td>
<td align=
"center" width=
"100%">Python Library Reference
</td>
<td class='online-navigation'
><a rel=
"contents" title=
"Table of Contents"
href=
"contents.html"><img src='../icons/contents.png'
border='
0' height='
32' alt='Contents' width='
32'
/></A></td>
<td class='online-navigation'
><a href=
"modindex.html" title=
"Module Index"><img src='../icons/modules.png'
border='
0' height='
32' alt='Module Index' width='
32'
/></a></td>
<td class='online-navigation'
><a rel=
"index" title=
"Index"
href=
"genindex.html"><img src='../icons/index.png'
border='
0' height='
32' alt='Index' width='
32'
/></A></td>
<div class='online-navigation'
>
<b class=
"navlabel">Previous:
</b>
<a class=
"sectref" rel=
"prev" href=
"module-xml.dom.html">13.6 xml.dom
</A>
<b class=
"navlabel">Up:
</b>
<a class=
"sectref" rel=
"parent" href=
"module-xml.dom.html">13.6 xml.dom
</A>
<b class=
"navlabel">Next:
</b>
<a class=
"sectref" rel=
"next" href=
"node652.html">13.6.2 Objects in the
</A>
<!--End of Navigation Panel-->
<H2><A NAME=
"SECTION0015610000000000000000">
13.6.1 Module Contents
</A>
The
<tt class=
"module">xml.dom
</tt> contains the following functions:
<dl><dt><table cellpadding=
"0" cellspacing=
"0"><tr valign=
"baseline">
<td><nobr><b><tt id='l2h-
4353' xml:id='l2h-
4353'
class=
"function">registerDOMImplementation
</tt></b>(
</nobr></td>
<td><var>name, factory
</var>)
</td></tr></table></dt>
Register the
<var>factory
</var> function with the name
<var>name
</var>. The
factory function should return an object which implements the
<tt class=
"class">DOMImplementation
</tt> interface. The factory function can return
the same object every time, or a new one for each call, as appropriate
for the specific implementation (e.g. if that implementation supports
<dl><dt><table cellpadding=
"0" cellspacing=
"0"><tr valign=
"baseline">
<td><nobr><b><tt id='l2h-
4354' xml:id='l2h-
4354'
class=
"function">getDOMImplementation
</tt></b>(
</nobr></td>
<td><var></var><big>[
</big><var>name
</var><big>[
</big><var>, features
</var><big>]
</big><var></var><big>]
</big><var></var>)
</td></tr></table></dt>
Return a suitable DOM implementation. The
<var>name
</var> is either
well-known, the module name of a DOM implementation, or
<code>None
</code>. If it is not
<code>None
</code>, imports the corresponding
module and returns a
<tt class=
"class">DOMImplementation
</tt> object if the import
succeeds. If no name is given, and if the environment variable
<a class=
"envvar" id='l2h-
4359' xml:id='l2h-
4359'
>PYTHON_DOM
</a> is set, this variable is used to find the
If name is not given, this examines the available implementations to
find one with the required feature set. If no implementation can be
found, raise an
<tt class=
"exception">ImportError
</tt>. The features list must be a
sequence of
<code>(
<var>feature
</var>,
<var>version
</var>)
</code> pairs which are
passed to the
<tt class=
"method">hasFeature()
</tt> method on available
<tt class=
"class">DOMImplementation
</tt> objects.
Some convenience constants are also provided:
<dl><dt><b><tt id='l2h-
4355' xml:id='l2h-
4355'
>EMPTY_NAMESPACE
</tt></b></dt>
The value used to indicate that no namespace is associated with a
node in the DOM. This is typically found as the
<tt class=
"member">namespaceURI
</tt> of a node, or used as the
<var>namespaceURI
</var>
parameter to a namespaces-specific method.
<span class=
"versionnote">New in version
2.2.
</span>
<dl><dt><b><tt id='l2h-
4356' xml:id='l2h-
4356'
>XML_NAMESPACE
</tt></b></dt>
The namespace URI associated with the reserved prefix
<code>xml
</code>, as
href=
"http://www.w3.org/TR/REC-xml-names/"
title=
"Namespaces in XML"
>Namespaces in XML
</a></em>
<span class=
"versionnote">New in version
2.2.
</span>
<dl><dt><b><tt id='l2h-
4357' xml:id='l2h-
4357'
>XMLNS_NAMESPACE
</tt></b></dt>
The namespace URI for namespace declarations, as defined by
href=
"http://www.w3.org/TR/DOM-Level-2-Core/core.html"
Object Model (DOM) Level 2 Core Specification"
Object Model (DOM) Level
2 Core Specification
</a></em> (section
1.1.8).
<span class=
"versionnote">New in version
2.2.
</span>
<dl><dt><b><tt id='l2h-
4358' xml:id='l2h-
4358'
>XHTML_NAMESPACE
</tt></b></dt>
The URI of the XHTML namespace as defined by
href=
"http://www.w3.org/TR/xhtml1/"
title=
"XHTML 1.0: The Extensible
HyperText Markup Language"
>XHTML
1.0: The Extensible
HyperText Markup Language
</a></em> (section
3.1.1).
<span class=
"versionnote">New in version
2.2.
</span>
In addition,
<tt class=
"module">xml.dom
</tt> contains a base
<tt class=
"class">Node
</tt> class and
the DOM exception classes. The
<tt class=
"class">Node
</tt> class provided by this
module does not implement any of the methods or attributes defined by
the DOM specification; concrete DOM implementations must provide
those. The
<tt class=
"class">Node
</tt> class provided as part of this module does
provide the constants used for the
<tt class=
"member">nodeType
</tt> attribute on
concrete
<tt class=
"class">Node
</tt> objects; they are located within the class
rather than at the module level to conform with the DOM
<div class='online-navigation'
>
<table align=
"center" width=
"100%" cellpadding=
"0" cellspacing=
"2">
<td class='online-navigation'
><a rel=
"prev" title=
"13.6 xml.dom "
href=
"module-xml.dom.html"><img src='../icons/previous.png'
border='
0' height='
32' alt='Previous Page' width='
32'
/></A></td>
<td class='online-navigation'
><a rel=
"parent" title=
"13.6 xml.dom "
href=
"module-xml.dom.html"><img src='../icons/up.png'
border='
0' height='
32' alt='Up One Level' width='
32'
/></A></td>
<td class='online-navigation'
><a rel=
"next" title=
"13.6.2 Objects in the"
href=
"node652.html"><img src='../icons/next.png'
border='
0' height='
32' alt='Next Page' width='
32'
/></A></td>
<td align=
"center" width=
"100%">Python Library Reference
</td>
<td class='online-navigation'
><a rel=
"contents" title=
"Table of Contents"
href=
"contents.html"><img src='../icons/contents.png'
border='
0' height='
32' alt='Contents' width='
32'
/></A></td>
<td class='online-navigation'
><a href=
"modindex.html" title=
"Module Index"><img src='../icons/modules.png'
border='
0' height='
32' alt='Module Index' width='
32'
/></a></td>
<td class='online-navigation'
><a rel=
"index" title=
"Index"
href=
"genindex.html"><img src='../icons/index.png'
border='
0' height='
32' alt='Index' width='
32'
/></A></td>
<div class='online-navigation'
>
<b class=
"navlabel">Previous:
</b>
<a class=
"sectref" rel=
"prev" href=
"module-xml.dom.html">13.6 xml.dom
</A>
<b class=
"navlabel">Up:
</b>
<a class=
"sectref" rel=
"parent" href=
"module-xml.dom.html">13.6 xml.dom
</A>
<b class=
"navlabel">Next:
</b>
<a class=
"sectref" rel=
"next" href=
"node652.html">13.6.2 Objects in the
</A>
<span class=
"release-info">Release
2.4.2, documentation updated on
28 September
2005.
</span>
<!--End of Navigation Panel-->
See
<i><a href=
"about.html">About this document...
</a></i> for information on suggesting changes.