26def StyleRefElement(stylename=None, classnames=None, **args):
28 if stylename
is not None:
29 f = stylename.getAttrNS(STYLENS,
'family')
31 qattrs[(DRAWNS,
u'style-name')]= stylename
32 elif f ==
'presentation':
33 qattrs[(PRESENTATIONNS,
u'style-name')]= stylename
35 raise ValueError(
"Style's family must be either 'graphic' or 'presentation'")
36 if classnames
is not None:
37 f = classnames[0].getAttrNS(STYLENS,
'family')
39 qattrs[(DRAWNS,
u'class-names')]= classnames
40 elif f ==
'presentation':
41 qattrs[(PRESENTATIONNS,
u'class-names')]= classnames
43 raise ValueError(
"Style's family must be either 'graphic' or 'presentation'")
44 return Element(qattributes=qattrs, **args)