The xml.dom contains the following functions:
xml.dom 包含以下函式:
name, factory) |
7.3以name注册"工厂(factory)函式". "工厂函式"应该返回一个 DOMImplementation对象实例. 所谓"工厂函式",就是每次调用总能返回适当的对象实例,依据特定的实现. (例如:支持某些定制的实现)
(译按:行文有待斟酌!)
[name[, features ]]) |
None
. If it is not None
, imports the corresponding
module and returns a DOMImplementation object if the import
succeeds. If no name is given, and if the environment variable
PYTHON_DOM is set, this variable is used to find the
implementation.
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 ImportError. The features list must be a
sequence of (feature, version)
pairs which are
passed to the hasFeature() method on available
DOMImplementation objects.
Some convenience constants are also provided:
xml
, as
defined by
Namespaces in XML
(section 4).
New in version 2.2.
In addition, xml.dom contains a base Node class and the DOM exception classes. The Node 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 Node class provided as part of this module does provide the constants used for the nodeType attribute on concrete Node objects; they are located within the class rather than at the module level to conform with the DOM specifications.