Paper Office
paper-docxAPI referenceoxml.styles

CT_Style

paper-docx 0.2.0 API reference

A <w:style> element, representing a style definition.

Attributes

base_style

attributebase_style

Sibling 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_val

Value 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_val

Value of w:locked/@w:val or False if not present.

name

attributename
= ZeroOrOne('w:name', successors=(_tag_seq[1:]))

name_val

attributename_val

Value of <w:name> child or None if not present.

next

attributenext
= ZeroOrOne('w:next', successors=(_tag_seq[4:]))

next_style

attributenext_style

Sibling 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_val

Value 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_val

Value 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_val

Value of <w:uiPriority> child or None if not present.

unhideWhenUsed

attributeunhideWhenUsed
= ZeroOrOne('w:unhideWhenUsed', successors=(_tag_seq[10:]))

unhideWhenUsed_val

attributeunhideWhenUsed_val

Value of w:unhideWhenUsed/@w:val or False if not present.

xml

attributexmlstr

XML 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 | None

First child with tag in tagnames, or None if not found.

paramtagnamesstr
= ()

Returns

lxml.etree._Element | None

insert_element_before

funcinsert_element_before(elm: ElementBase, *tagnames: str)
paramelmElementBase
paramtagnamesstr
= ()

remove_all

funcremove_all(*tagnames: str) -> None

Remove child elements with tagname (e.g. "a:p") in tagnames.

paramtagnamesstr
= ()

Returns

None

xpath

funcxpath(xpath_str: str) -> Any

Override of lxml _Element.xpath() method.

Provides standard Open XML namespace mapping (nsmap) in centralized location.

paramxpath_strstr

Returns

typing.Any

On this page