StackOfOpenElements

StackOfOpenElements

Overview

StackOfOpenElements is a class in Aspose.Html FOSS for Python.

The stack of open elements as defined in §13.2.4.2.

This class provides 12 methods for working with StackOfOpenElements objects in Python programs. Available methods include: __init__, contains_node, has_in_button_scope, has_in_list_item_scope, has_in_scope, has_in_select_scope, has_in_table_scope, index_of, pop, pop_until, pop_until_node, push. All public members are accessible to any Python application after installing the Aspose.Html FOSS for Python package. Properties: bottom, current.

Properties

NameTypeAccessDescription
currentElement | NoneReadThe topmost element, or None if empty.
bottomElement | NoneReadThe bottom-most element, or None if empty.

Methods

SignatureDescription
__init__()Calls init on this StackOfOpenElements instance.
push(element: Element)Push element onto the top of the stack.
pop()ElementPop and return the current (top) element.
pop_until()Pop elements until an element with one of tag_names is popped.
pop_until_node(node: Element)Pop elements until node is popped.
contains_node(node: Element)boolTrue if the exact node object is on the stack.
has_in_scope(tag_name: str)bool§13.2.4.2 — has element in scope.
has_in_button_scope(tag_name: str)bool§13.2.4.2 — has element in button scope.
has_in_list_item_scope(tag_name: str)bool§13.2.4.2 — has element in list item scope.
has_in_table_scope(tag_name: str)bool§13.2.4.2 — has element in table scope.
has_in_select_scope(tag_name: str)bool§13.2.4.2 — has element in select scope.
index_of(element: Element)intReturn 0-based index from bottom, or -1 if not found.

See Also