class documentation
class etree_visualize_selection:
Constructor: etree_visualize_selection(tree, xpath_or_elements, reindent, mark_text, ...)
Produces a colorized representation of selection within an XML document. (works only within IPython/jupyter style notebooks, via a HTML representation.)
Method | __init__ |
Produces a colorized representation of selection within an XML document. (works only within IPython/jupyter style notebooks. works via a HTML representation.) |
Instance Variable | mark |
Undocumented |
Instance Variable | mark |
Undocumented |
Instance Variable | mark |
Undocumented |
Instance Variable | tree |
Undocumented |
Instance Variable | xpath |
Undocumented |
Method | _repr |
Undocumented |
def __init__(self, tree, xpath_or_elements, reindent:
bool
= True, mark_text: bool
= True, mark_tail: bool
= False, mark_subtree: bool
= False):
¶
Produces a colorized representation of selection within an XML document. (works only within IPython/jupyter style notebooks. works via a HTML representation.)
Given
- a parsed tree (or a bytes object, will be parsed, but you probably shouldn't do that)
- either
- a sequence of elements from a tree (that you probably selected yourself)
- or a string, interpreted as xpath
...and optionally:
- reindent display reindented copy of the tree (defaults True, this is debug function)
- mark_text: mark initial text content of each matched element)
- mark_tail: mark tail-text after each matched element)
- mark_subtree: mark entire tree under each matched element. Useful
Mostly used in the tutorials