class documentation
class etree_visualize_selection:
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=True, mark_text=True, mark_tail=False, mark_subtree=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
Parameters | |
tree | Undocumented |
xpath | Undocumented |
reindent:bool | Undocumented |
markbool | Undocumented |
markbool | Undocumented |
markbool | Undocumented |