def get_name_attrs_from_tag(self, xml):
        """ Gets name and attributes from start tag xml. """
        name = ""
        attrs = {}
        xml = xml.replace("'", '"')
        xbuf = XBuffer(xml)
        xbuf.inc_index()  # skip past '<'
        xbuf.skip_space()
        found_delimiter, name = xbuf.get_chars_to_delimiter([' ', '/','>'])
        c = xbuf.get_char()
        while True:
            if c == ' ':
                xbuf.skip_space()
                found_delimiter, attr_name = xbuf.get_chars_to_delimiter(['='])
                c = xbuf.get_next_char()
                if c == '"':
                    xbuf.inc_index()
                    found_delimiter, attr_val = xbuf.get_chars_to_delimiter(['"'])
                    c = xbuf.get_char()
                    if c == '"':
                        attrs[attr_name] = attr_val
                        xbuf.inc_index()
                else:
                    msg = "XmlDoc::get_name_attrs_from_tag [%s] reached end of buffer too soon." \
                            % xml
                    self.handle_error(msg)
                c = xbuf.get_char()      
            else:
                break 
    
        return name, attrs
 Gets name and attributes from start tag xml. 
recipes/Python/579133_MicroXml_Standalone_library_basic_XML/recipe-579133.py