'Basic constructor.'

def __init__(self, parser, name, attrs=None, parent=None, previous=None):

    self.parserClass = parser.__class__
    self.isSelfClosing = parser.isSelfClosingTag(name)
    self.name = name
    if (attrs == None):
        attrs = []
    self.attrs = attrs
    self.contents = []
    self.setup(parent, previous)
    self.hidden = False
    self.containsSubstitutions = False
    self.convertHTMLEntities = parser.convertHTMLEntities
    self.convertXMLEntities = parser.convertXMLEntities
    self.escapeUnrecognizedEntities = parser.escapeUnrecognizedEntities
    def convert(kval):
        'Converts    HTML,    XML    and    numeric    entities    in    the    attribute    value.'
        (k, val) = kval
        if (val is None):
            return kval
        return (k, re.sub('&(#\\d+|#x[0-9a-fA-F]+|\\w+);', self._convertEntities, val))
    self.attrs = map(convert, self.attrs)
