mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Patch #103885: Add dynamic registration and lookup of DOM implementations.
This commit is contained in:
parent
f5d3ea00b9
commit
7edbd4ffb4
4 changed files with 111 additions and 0 deletions
|
@ -85,6 +85,36 @@ the strict mapping from IDL). See section \ref{dom-conformance},
|
|||
{This specifies the mapping from OMG IDL to Python.}
|
||||
\end{seealso}
|
||||
|
||||
\subsection{Module Contents}
|
||||
|
||||
The \module{xml.dom} contains the following functions:
|
||||
|
||||
\begin{funcdesc}{registerDOMImplementation}{name, factory}
|
||||
Register the \var{factory} function with the \var{name}. The factory
|
||||
function should return an object which implements the
|
||||
\code{DOMImplementation| interface. The factory function can either return
|
||||
the same object, or a new one (e.g. if that implementation supports
|
||||
some customization).
|
||||
\end{funcdesc}
|
||||
|
||||
\begin{funcdesc}{getDOMImplementation}{name = None, features = ()}
|
||||
Return a suitable DOM implementation. The \var{name} is either
|
||||
well-known, the module name of a DOM implementation, or
|
||||
\code{None}. If it is not \code{None}, imports the corresponding module and
|
||||
returns a \class{DOMImplementation} object if the import succeeds. If
|
||||
no name is given, and if the environment variable \code{PYTHON_DOM} is
|
||||
set, this variable is used to find the implementation.
|
||||
|
||||
If name is not given, consider the available implementations to find
|
||||
one with the required feature set. If no implementation can be found,
|
||||
raise an \exception{ImportError}. The features list must be a sequence of
|
||||
(feature, version) pairs which are passed to hasFeature.
|
||||
\end{funcdesc}
|
||||
|
||||
% Should the Node documentation go here?
|
||||
|
||||
In addition, \module{xml.dom} contains the \class{Node}, and the DOM
|
||||
exceptions.
|
||||
|
||||
\subsection{Objects in the DOM \label{dom-objects}}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue