'Basic constructor.'

def __init__(self, parser=None, builder=None, name=None, namespace=None, prefix=None, attrs=None, parent=None, previous=None, is_xml=None):

    if (parser is None):
        self.parser_class = None
    else:
        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 (builder is not None):
        preserve_whitespace_tags = builder.preserve_whitespace_tags
    elif is_xml:
        preserve_whitespace_tags = []
    else:
        preserve_whitespace_tags = HTMLAwareEntitySubstitution.preserve_whitespace_tags
    self.preserve_whitespace_tags = preserve_whitespace_tags
    if (attrs is None):
        attrs = {}
    elif attrs:
        if ((builder is not None) and builder.cdata_list_attributes):
            attrs = builder._replace_cdata_list_attribute_values(self.name, attrs)
        else:
            attrs = dict(attrs)
    else:
        attrs = dict(attrs)
    if builder:
        self.known_xml = builder.is_xml
    else:
        self.known_xml = is_xml
    self.attrs = attrs
    self.contents = []
    self.setup(parent, previous)
    self.hidden = False
    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
