def parse_begin_tag(self):
        b = self.feed(self.r_begin_tag)
        if b:
            tag_name = self.decode(b.group(2))
            self.stack.append(tag_name)
            if not self.tag:
                self.tag = tag_name
            top = {'_attrs':OrderedDict(), '_text':''}
            top_v = self.top.get(tag_name)
            if top_v:
                if isinstance(top_v, list):
                    top_v.append(top)
                else:
                    self.top[tag_name] = [top_v, top]
            else:
                self.top[tag_name] = top
            self.top = top
            text = self.text[b.span(2)[1]:b.span()[1]-1]
            pos = 0
            text_len = len(text)
            while pos < text_len:
                b = self.r_space.match(text, pos)
                if b:
                    pos = b.span()[1]
                if pos >= text_len:break
                #get attrname
                b = self.r_attrname.match(text, pos)
                if b:
                    attrname = self.decode(b.group())
                    pos = b.span()[1]
                else:
                    raise ParseError("No attrname found in {}".format(text))
                #guess =
                b = self.r_equal.match(text, pos)
                if b:
                    pos = b.span()[1]
                    if text[pos] == '"':
                        b = self.r_string1.match(text, pos)
                    elif text[pos] == "'":
                        b = self.r_string2.match(text, pos)
                    else:
                        b = self.r_string3.match(text, pos)
                    if b:
                        attrvalue = self.decode(b.group(1))
                        pos = b.span()[1]
                else:
                    attrvalue = attrname
                self.top['_attrs'][attrname] = attrvalue

        else:
            raise ParseError('Begin tag {} is not correct'.format(self.text[self.pos:20]))
dataset/ETHPy150Open limodou/uliweb/uliweb/core/taglibs.py/ParseXML.parse_begin_tag/original