Class ElementFactory
object --+
         |
        ElementFactory
Factory for Element objects.
A new element is created simply by accessing a correspondingly named
attribute of the factory object:
>>> factory = ElementFactory()
>>> print(factory.foo)
<foo/>
>>> print(factory.foo(id=2))
<foo id="2"/>
Markup fragments (lists of nodes without a parent element) can be created
by calling the factory:
>>> print(factory('Hello, ', factory.em('world'), '!'))
Hello, <em>world</em>!
A factory can also be bound to a specific namespace:
>>> factory = ElementFactory('http://www.w3.org/1999/xhtml')
>>> print(factory.html(lang="en"))
<html xmlns="http://www.w3.org/1999/xhtml" lang="en"/>
The namespace for a specific element can be altered on an existing factory
by specifying the new namespace using item access:
>>> factory = ElementFactory()
>>> print(factory.html(factory['http://www.w3.org/2000/svg'].g(id=3)))
<html><g xmlns="http://www.w3.org/2000/svg" id="3"/></html>
Usually, the ElementFactory class is not be used directly. Rather, the
tag instance should be used to create elements.
    |  | 
        
          | __init__(self,
        namespace=None) Create the factory, optionally bound to the given namespace.
 |  |  | 
    | Fragment | 
        
          | __call__(self,
        *args) Create a fragment that has the given positional arguments as child
nodes.
 |  |  | 
    | ElementFactory | 
        
          | __getitem__(self,
        namespace) Return a new factory that is bound to the specified namespace.
 |  |  | 
    | Element |  | 
  
    | Inherited from object:__delattr__,__format__,__getattribute__,__hash__,__new__,__reduce__,__reduce_ex__,__repr__,__setattr__,__sizeof__,__str__,__subclasshook__ | 
  
    | Inherited from object:__class__ | 
| 
  Create the factory, optionally bound to the given namespace.| __init__(self,
        namespace=None)
    (Constructor)
 |  |  
    Parameters:
        namespace- the namespace URI for any created elements, orNonefor no namespaceOverrides:
        object.__init__
     | 
 
| 
  Create a fragment that has the given positional arguments as child
nodes.| __call__(self,
        *args)
    (Call operator)
 |  |  
    Returns: Fragmentthe created Fragment | 
 
| 
  Return a new factory that is bound to the specified namespace.| __getitem__(self,
        namespace)
    (Indexing operator)
 |  |  
    Parameters:
        namespace- the namespace URI or Namespace objectReturns: ElementFactoryan ElementFactory that produces elements bound to the given
namespace | 
 
| 
  Create an Element with the given name.| __getattr__(self,
        name)
    (Qualification operator)
 |  |  
    Parameters:
        name- the tag name of the element to createReturns: Elementan Element with the specified name |