Skip to content

Commit 82c080b

Browse files
author
Steve Canny
committed
oxml: convert CT_Styles to xmlchemy
1 parent 0327558 commit 82c080b

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

docx/oxml/parts/styles.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
Custom element classes related to the styles part
55
"""
66

7-
from ..ns import qn
8-
from ..xmlchemy import BaseOxmlElement, ZeroOrOne
7+
from ..xmlchemy import BaseOxmlElement, ZeroOrMore, ZeroOrOne
98

109

1110
class CT_Style(BaseOxmlElement):
@@ -22,6 +21,8 @@ class CT_Styles(BaseOxmlElement):
2221
``<w:styles>`` element, the root element of a styles part, i.e.
2322
styles.xml
2423
"""
24+
style = ZeroOrMore('w:style', successors=())
25+
2526
def style_having_styleId(self, styleId):
2627
"""
2728
Return the ``<w:style>`` child element having ``styleId`` attribute
@@ -32,10 +33,3 @@ def style_having_styleId(self, styleId):
3233
return self.xpath(xpath)[0]
3334
except IndexError:
3435
raise KeyError('no <w:style> element with styleId %d' % styleId)
35-
36-
@property
37-
def style_lst(self):
38-
"""
39-
List of <w:style> child elements.
40-
"""
41-
return self.findall(qn('w:style'))

0 commit comments

Comments
 (0)