Element
#
- class src.pyconverter.xml2py.ast_tree.Element(element, parse_children=True)#
Provides the base element.
Overview#
Return wether the element has children. |
|
Get an item from an element. |
|
Print the tree. |
|
Return the string types. |
|
Get children of a specific type. |
|
Get the titles of the elements in a list of elements. |
|
Return a string to enable converting the element to an RST format. |
|
Find the first type matching a given type string recursively. |
|
Find the first type matching a given type string. |
|
Find all types matching a given type string. |
Text content. |
|
Raw string of the element. |
|
Attributes of the element as a dictionary. |
|
Has the revision flag |
|
Returns |
|
Tail of the element as a string. |
|
Children of the tree. |
|
Types of the children. |
|
Element title. |
|
Text content. |
|
ID of the element. |
|
Next element. |
|
Previous element. |
|
Element tag. |
Import detail#
from src.pyconverter.xml2py.ast_tree import Element
Property detail#
- property Element.text_content#
Text content.
- property Element.raw#
Raw string of the element.
- property Element.tostring#
Attributes of the element as a dictionary.
- property Element.added#
Has the revision flag
added
.
- property Element.any_isalnum#
Returns
True
if any characters are alphanumeric.
- property Element.tail#
Tail of the element as a string.
- property Element.children#
Children of the tree.
- property Element.children_types#
Types of the children.
- property Element.title#
Element title.
- property Element.content#
Text content.
- property Element.id#
ID of the element.
- property Element.next_elem#
Next element.
- property Element.prev_elem#
Previous element.
- property Element.tag#
Element tag.
Method detail#
- Element.has_children()#
Return wether the element has children.
- Element.get(entry)#
Get an item from an element.
- Element.print_tree()#
Print the tree.
- Element.types_repr()#
Return the string types.
- Element.__getitem__(index)#
- Element.__len__()#
- Element.get_children_by_type(type_name)#
Get children of a specific type.
- Element.get_titles_in_element_list()#
Get the titles of the elements in a list of elements.
- Element.__repr__()#
- Element.to_rst(indent='', max_length=100, links=None, base_url=None, fcache=None)#
Return a string to enable converting the element to an RST format.
- Element.rec_find(_type, terms=None)#
Find the first type matching a given type string recursively.
- Element.find(_type, terms=None)#
Find the first type matching a given type string.
- Element.find_all(_type, recursive=False, terms=None)#
Find all types matching a given type string.