A node to represents an HTML empty element.
An HTML element without content is called an empty node. It has a start tag but neither a content nor an end tag.
A node to represents an HTML empty element.
An HTML element without content is called an empty node. It has a start tag but neither a content nor an end tag.
Create a new empty node.
def __init__(self, parent: str, identifier: str, tag: str, attributes: dict=dict()):
"""Create a new empty node.
:param parent: (str) Parent identifier
:param identifier: (str) This node identifier
:param tag: (str) The element tag
:param attributes: (dict) key=(str) value=(str or None)
:raises: NodeInvalidIdentifierError:
:raises: NodeTagError:
:raises: TypeError:
"""
super(EmptyNode, self).__init__(parent, identifier, tag, attributes)
if self.tag not in HTML_EMPTY_TAGS.keys():
raise NodeTagError(tag)