CT_Style
paper-docx 0.2.0 API reference
A <w:style> element, representing a style definition.
Attributes
base_style
attributebase_styleSibling CT_Style element this style is based on or None if no base style or
base style not found.
basedOn
attributebasedOn= ZeroOrOne('w:basedOn', successors=(_tag_seq[3:]))basedOn_val
attributebasedOn_valValue of w:basedOn/@w:val or None if not present.
customStyle
attributecustomStyle= OptionalAttribute('w:customStyle', ST_OnOff)default
attributedefault= OptionalAttribute('w:default', ST_OnOff)locked
attributelocked= ZeroOrOne('w:locked', successors=(_tag_seq[12:]))locked_val
attributelocked_valValue of w:locked/@w:val or False if not present.
name
attributename= ZeroOrOne('w:name', successors=(_tag_seq[1:]))name_val
attributename_valValue of <w:name> child or None if not present.
next
attributenext= ZeroOrOne('w:next', successors=(_tag_seq[4:]))next_style
attributenext_styleSibling CT_Style element identified by the value of w:name/@w:val or None
if no value is present or no style with that style id is found.
pPr
attributepPr= ZeroOrOne('w:pPr', successors=(_tag_seq[17:]))qFormat
attributeqFormat= ZeroOrOne('w:qFormat', successors=(_tag_seq[11:]))qFormat_val
attributeqFormat_valValue of w:qFormat/@w:val or False if not present.
rPr
attributerPr= ZeroOrOne('w:rPr', successors=(_tag_seq[18:]))semiHidden
attributesemiHidden= ZeroOrOne('w:semiHidden', successors=(_tag_seq[9:]))semiHidden_val
attributesemiHidden_valValue of <w:semiHidden> child or False if not present.
styleId
attributestyleIdstr | None= OptionalAttribute('w:styleId', ST_String)type
attributetypeWD_STYLE_TYPE | None= OptionalAttribute('w:type', WD_STYLE_TYPE)uiPriority
attributeuiPriority= ZeroOrOne('w:uiPriority', successors=(_tag_seq[8:]))uiPriority_val
attributeuiPriority_valValue of <w:uiPriority> child or None if not present.
unhideWhenUsed
attributeunhideWhenUsed= ZeroOrOne('w:unhideWhenUsed', successors=(_tag_seq[10:]))unhideWhenUsed_val
attributeunhideWhenUsed_valValue of w:unhideWhenUsed/@w:val or False if not present.
xml
attributexmlstrXML string for this element, suitable for testing purposes.
Pretty printed for readability and without an XML declaration at the top.
Functions
delete
funcdelete()Remove this w:style element from its parent w:styles element.
first_child_found_in
funcfirst_child_found_in(*tagnames: str) -> _Element | NoneFirst child with tag in tagnames, or None if not found.
paramtagnamesstr= ()Returns
lxml.etree._Element | Noneinsert_element_before
funcinsert_element_before(elm: ElementBase, *tagnames: str)paramelmElementBaseparamtagnamesstr= ()remove_all
funcremove_all(*tagnames: str) -> NoneRemove child elements with tagname (e.g. "a:p") in tagnames.
paramtagnamesstr= ()Returns
Nonexpath
funcxpath(xpath_str: str) -> AnyOverride of lxml _Element.xpath() method.
Provides standard Open XML namespace mapping (nsmap) in centralized location.
paramxpath_strstrReturns
typing.Any