(self, parser=None, builder=None, name=None, namespace=None,
                 prefix=None, attrs=None, parent=None, previous=None)
Basic constructor.
Basic constructor.
Basic constructor .
def __init__(self, parser=None, builder=None, name=None, namespace=None,
                 prefix=None, attrs=None, parent=None, previous=None):
        "Basic constructor."

        if parser is None:
            self.parser_class = None
        else:
            # We don't actually store the parser object: that lets extracted
            # chunks be garbage-collected.
            self.parser_class = parser.__class__
        if name is None:
            raise ValueError("No value provided for new tag's name.")
        self.name = name
        self.namespace = namespace
        self.prefix = prefix
        if attrs is None:
            attrs = {}
        elif attrs and builder.cdata_list_attributes:
            attrs = builder._replace_cdata_list_attribute_values(
                self.name, attrs)
        else:
            attrs = dict(attrs)
        self.attrs = attrs
        self.contents = []
        self.setup(parent, previous)
        self.hidden = False

        # Set up any substitutions, such as the charset in a META tag.
        if builder is not None:
            builder.set_up_substitutions(self)
            self.can_be_empty_element = builder.can_be_empty_element(name)
        else:
            self.can_be_empty_element = False
def __init__ ( self , parser = None , builder = None , name = None , namespace = None , prefix = None , attrs = None , parent = None , previous = None ) : if parser is None : self . parser_class = None else : # We don't actually store the parser object: that lets extracted # chunks be garbage-collected. self . parser_class = parser . __class__ if name is None : raise ValueError ( "No value provided for new tag's name." ) self . name = name self . namespace = namespace self . prefix = prefix if attrs is None : attrs = { } elif attrs and builder . cdata_list_attributes : attrs = builder . _replace_cdata_list_attribute_values ( self . name , attrs ) else : attrs = dict ( attrs ) self . attrs = attrs self . contents = [ ] self . setup ( parent , previous ) self . hidden = False # Set up any substitutions, such as the charset in a META tag. if builder is not None : builder . set_up_substitutions ( self ) self . can_be_empty_element = builder . can_be_empty_element ( name ) else : self . can_be_empty_element = False