<style>
(Style Definition)
This element specifies the definition of a single style within a WordprocessingML document. A style is a predefined set of table, numbering, paragraph, and/or character properties which can be applied to regions within a document.
The style definition for any style definition can be divided into three segments:
General style properties
Style type
Type-specific properties
General style properties refers to the set of properties which can be used regardless of the type of style; for example, the style name, additional aliases for the style, a style ID (used by the document content to refer to the style), if style is hidden, if style is locked, etc.
<w:style w:type="paragraph" w:styleId="Heading1"> <w:name w:val="Heading 1"/> <w:basedOn w:val="Normal"/> <w:next w:val="Normal"/> <w:link w:val="Heading1Char"/> <w:priority w:val="1"/> <w:qformat/> <w:rsid w:val="00F303CE"/> … </w:style>
Above the formatting information specific to this style type are a set of general style properties which define information shared by all style types. ]
Style types refers to the property on a style which defines the type of style created with this style definition. WordprocessingML supports six types of style definitions by the values for the style definition's @type
attribute:
Paragraph styles
Character styles
Linked styles (paragraph + character) [: Accomplished via the
<link>
element (§2.7.3.6). ]Table styles
Numbering styles
Default paragraph + character properties
<w:style w:type="paragraph" w:styleId="Heading1"> <w:name w:val="heading 1"/> <w:basedOn w:val="Normal"/> <w:next w:val="Normal"/> <w:link w:val="Heading1Char"/> <w:priority w:val="1"/> <w:qformat/> <w:rsid w:val="00F303CE"/> … </w:style>
The @type
attribute has a value of paragraph
, which indicates that the following style definition is a paragraph style. ]
Type-specific properties refers to the payload of the style: its formatting information as well as any properties which apply only to that type of style.
<w:style w:type="table" w:default="1" w:styleId="TableNormal"> <w:name w:val="Normal Table"/> … <w:tblPr> <w:tblInd w:w="0" w:type="dxa"/> <w:tblCellMar> <w:top w:w="0" w:type="dxa"/> <w:left w:w="108" w:type="dxa"/> <w:bottom w:w="0" w:type="dxa"/> <w:right w:w="108" w:type="dxa"/> </w:tblCellMar> </w:tblPr> </w:style>
The <tblPr>
element contains the formatting payload for this table style, which is only applicable to a table style. ]
Parent Elements |
---|
|
Child Elements |
Subclause |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Attributes |
Description |
---|---|
|
Specifies that this style is a user-defined style (i.e. it is not a style which was automatically generated by an application). This setting (specifically a value of If this attribute is omitted, then the style shall be assumed to be a built-in style. <w:style w:type="paragraph" w:styleId="MyStyle" w:customStyle="true"> <w:name w:val="My Paragraph Style"/> <w:rPr> <w:b/> </w:rPr> </w:style> This paragraph style specifies that it is a user-defined style using the The possible values for this attribute are defined by the ST_OnOff simple type (§2.18.67). |
|
Specifies that this style is the default for this type of style. This property is used in conjunction with the If this attribute is not specified for any style, then no properties shall be applied to objects of the specified type. If this attribute is specified by multiple styles, then the last instance of a style with this property shall be used. <w:style w:type="paragraph" w:default="1" w:styleId="MyStyle" > <w:name w:val="My Paragraph Style"/> <w:rPr> <w:b/> </w:rPr> </w:style> This paragraph style specifies that it is the default paragraph style, and therefore all paragraphs which do not explicitly reference a paragraph style shall have this style applied. For example, consider the following paragraphs from the same WordprocessingML document: <w:p> <w:pPr> <w:pStyle w:val="Normal"/> </w:pPr> … </w:p> <w:p> … </w:p> The contents of the first paragraph shall have the The possible values for this attribute are defined by the ST_OnOff simple type (§2.18.67). |
|
Specifies a unique identifier for the parent style definition. This identifier shall be used in multiple contexts to uniquely reference this style definition within the document.
If multiple style definitions each declare the same value for their If this attribute is not specified, then a style ID may be assigned in any manner desired. <w:style w:type="paragraph" w:styleId="MyStyle" > <w:name w:val="My Paragraph Style"/> <w:rPr> <w:b/> </w:rPr> </w:style> This paragraph style specifies that its style identifier shall be Now consider the following paragraphs from the same WordprocessingML document: <w:p> <w:pPr> <w:pStyle w:val="MyStyle"/> </w:pPr> … </w:p> <w:p> … </w:p> The contents of the first paragraph shall have the bold paragraph property applied to them because their paragraph properties specify that they shall inherit the paragraph style whose The possible values for this attribute are defined by the ST_String simple type (§2.18.89). |
|
Specifies the type of style definition defined by this element. WordprocessingML supports six types of style definitions:
Each of the first four types corresponds to a different value in this attribute, and therefore defines the type of the current style. [: The last two types are unique in that they are not simply a style type: a linked style is a pairing of a character and paragraph style via the If this attribute is not specified, then the default value shall be assumed to be <w:style w:type="paragraph" … > <w:name w:val="My Paragraph Style"/> <w:rPr> <w:b/> </w:rPr> </w:style> The The possible values for this attribute are defined by the ST_StyleType simple type (§2.18.90). |
The following XML Schema fragment defines the contents of this element:
<complexType name="CT_Style">
<sequence>
<element name="name" type="CT_String" minOccurs="0" maxOccurs="1"/>
<element name="aliases" type="CT_String" minOccurs="0"/>
<element name="basedOn" type="CT_String" minOccurs="0"/>
<element name="next" type="CT_String" minOccurs="0"/>
<element name="link" type="CT_String" minOccurs="0"/>
<element name="autoRedefine" type="CT_OnOff" minOccurs="0"/>
<element name="hidden" type="CT_OnOff" minOccurs="0"/>
<element name="uiPriority" type="CT_DecimalNumber" minOccurs="0"/>
<element name="semiHidden" type="CT_OnOff" minOccurs="0"/>
<element name="unhideWhenUsed" type="CT_OnOff" minOccurs="0"/>
<element name="qFormat" type="CT_OnOff" minOccurs="0"/>
<element name="locked" type="CT_OnOff" minOccurs="0"/>
<element name="personal" type="CT_OnOff" minOccurs="0"/>
<element name="personalCompose" type="CT_OnOff" minOccurs="0"/>
<element name="personalReply" type="CT_OnOff" minOccurs="0"/>
<element name="rsid" type="CT_LongHexNumber" minOccurs="0"/>
<element name="pPr" type="CT_PPr" minOccurs="0" maxOccurs="1"/>
<element name="rPr" type="CT_RPr" minOccurs="0" maxOccurs="1"/>
<element name="tblPr" type="CT_TblPrBase" minOccurs="0" maxOccurs="1"/>
<element name="trPr" type="CT_TrPr" minOccurs="0" maxOccurs="1"/>
<element name="tcPr" type="CT_TcPr" minOccurs="0" maxOccurs="1"/>
<element name="tblStylePr" type="CT_TblStylePr" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
<attribute name="type" type="ST_StyleType" use="optional"/>
<attribute name="styleId" type="ST_String" use="optional"/>
<attribute name="default" type="ST_OnOff" use="optional"/>
<attribute name="customStyle" type="ST_OnOff" use="optional"/>
</complexType>