Package xml :: Package dom :: Module domreg
[hide private]
[frames] | no frames]

Module domreg

Registration facilities for DOM. This module should not be used directly. Instead, the functions getDOMImplementation and registerDOMImplementation should be imported from xml.dom.

Functions [hide private]
 
registerDOMImplementation(name, factory)
Register the factory function with the name.
Return 1 if the dom offers the features
_good_enough(dom, features)
DOM implementation
getDOMImplementation(name= None, features= ())
Return a suitable DOM implementation.
 
_parse_feature_string(s)
Variables [hide private]
  well_known_implementations = {'4DOM': 'xml.dom.DOMImplementati...
  registered = {}

Imports: NodeList, EmptyNodeList, defproperty, StringTypes


Function Details [hide private]

registerDOMImplementation(name, factory)

 

Register the factory function with the name. The factory function should return an object which implements the DOMImplementation interface. The factory function can either return the same object, or a new one (e.g. if that implementation supports some customization).

getDOMImplementation(name= None, features= ())

 

Return a suitable DOM implementation. The name is either well-known, the module name of a DOM implementation, or None. If it is not None, imports the corresponding module and returns DOMImplementation object if the import succeeds.

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 ImportError. The features list must be a sequence of (feature, version) pairs which are passed to hasFeature.

Returns: DOM implementation

Variables Details [hide private]

well_known_implementations

Value:
{'4DOM': 'xml.dom.DOMImplementation', 'minidom': 'xml.dom.minidom'}