class documentation

class Element:

View In Hierarchy

A very simple DOM-like representation for parsed epytext documents. Each epytext document is encoded as a tree whose nodes are Element objects, and whose leaves are strings. Each node is marked by a tag and zero or more attributes, attribs. Each attribute is a mapping from a string key to a string value.
Method __init__ Undocumented
Method __repr__ Undocumented
Method __str__ No summary
Instance Variable attribs A dictionary mapping attribute names to attribute values for this element.
Instance Variable children A list of the children of this element.
Instance Variable tag A string tag indicating the type of this element.
def __init__(self, tag, *children, **attribs):

Undocumented

Parameters
tag:strUndocumented
*children:Union[str, Element]Undocumented
**attribs:AnyUndocumented
def __repr__(self):

Undocumented

Returns
strUndocumented
def __str__(self):
Return a string representation of this element, using XML notation.
Returns
strUndocumented
Note
Doesn't escape '<' or '&' or '>', so the result is only XML-like and cannot actually be parsed as XML.
attribs =
A dictionary mapping attribute names to attribute values for this element.
children =
A list of the children of this element.
tag =
A string tag indicating the type of this element.