class documentation

class etree_visualize_selection:

View In Hierarchy

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_subtree Undocumented
Instance Variable mark_tail Undocumented
Instance Variable mark_text Undocumented
Instance Variable tree Undocumented
Instance Variable xpath_or_elements Undocumented
Method _repr_html_ 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
treeUndocumented
xpath_or_elementsUndocumented
reindent:boolUndocumented
mark_text:boolUndocumented
mark_tail:boolUndocumented
mark_subtree:boolUndocumented
mark_subtree =

Undocumented

mark_tail =

Undocumented

mark_text =

Undocumented

tree =

Undocumented

xpath_or_elements =

Undocumented

def _repr_html_(self):

Undocumented