'Collect the formatting for the style.
Styles have scope. The same name can be used for both paragraph and
character styles Since CSS has no scope we use a prefix. (Not elegant)
In ODF a style can have a parent, these parents can be chained.
We may not have encountered the parent yet, but if we have, we resolve it.'

def s_style_style(self, tag, attrs):

    name = attrs[(STYLENS, 'name')]
    name = name.replace('.', '_')
    family = attrs[(STYLENS, 'family')]
    htmlfamily = self.familymap.get(family, 'unknown')
    sfamily = self._familyshort.get(family, 'X')
    name = ('%s%s-%s' % (self.autoprefix, sfamily, name))
    parent = attrs.get((STYLENS, 'parent-style-name'))
    self.currentstyle = special_styles.get(name, ('.' + name))
    self.stylestack.append(self.currentstyle)
    if (self.currentstyle not in self.styledict):
        self.styledict[self.currentstyle] = {}
    self.styledict[self.currentstyle]['__style-family'] = htmlfamily
    if parent:
        parent = parent.replace('.', '_')
        parent = ('%s-%s' % (sfamily, parent))
        parent = special_styles.get(parent, ('.' + parent))
        if (parent in self.styledict):
            styles = self.styledict[parent]
            for (style, val) in styles.items():
                self.styledict[self.currentstyle][style] = val
        else:
            self.styledict[self.currentstyle]['__parent-style-name'] = parent
