<basedOn> (Parent Style ID)

This element specifies the style ID of the parent style from which this style inherits in the style inheritance. The style inheritance refers to a set of styles which inherit from one another to produce the resulting set of properties for a single style. The @val attribute of this element specifies the @styleId attribute for the parent style in the style inheritance.

If this element is omitted, then this style shall not be based on any other style in the current document (i.e. this element is the root of the style inheritance for a style). If no style in the current document specifies the @styleId present in the @val attribute, then this element shall be ignored (i.e. this element is the root of the style inheritance for a style).

If a style with this @styleId is present, then it shall be subject to the following restrictions:

  • If the current style is a table style, then the parent style must also be a table style, or this element shall be ignored.

  • If the current style is a paragraph style, then the parent style must also be a paragraph style, or this element shall be ignored.

  • If the current style is a character style, then the parent style must also be a character style, or this element shall be ignored.

  • If the current style is a numbering style, then this element shall be ignored.

example:
  • A character style with a @styleId value of Strong whose properties consist of the bold property

  • A character style with a @styleId value of Underline whose properties consist of the underline property

  • A character style with a @styleId value of Emphasis whose properties consist of the italics property

Each of these character styles defines a single character formatting property. If the <basedOn> values for each element were defined as follows:

<w:style w:styleId="Strong">
  <w:basedOn w:val="Underline"/><w:rPr>
    <w:b/>
  </w:rPr>
</w:style>
<w:style w:styleId="Underline">
  <w:basedOn w:val="Emphasis"/><w:rPr>
    <w:u/>
  </w:rPr>
</w:style>
<w:style w:styleId="Emphasis"><w:rPr>
    <w:i/>
  </w:rPr>
</w:style>

The Strong style is based on the Underline style which is in turn based on the Emphasis style. This means that the actual definition of the Strong style would be as follows:

  • Bold

  • Underline (inherited from Underline)

  • Italics (inherited from Emphasis)

The style chain for the Strong style would be defined as follows:

  • Emphasis

  • Underline

  • Strong

Similarly, the style chain for the Underline style would be defined as follows:

  • Emphasis

  • Underline

In each case, the style chain is the list of all styles which are combined in order to produce the entire set of properties for any given style. ]

Parent Elements

<style>2.7.3.17)

Attributes

Description

<val> (String Value)

Specifies that its contents will contain a string.

The contents of this string are interpreted based on the context of the parent XML element.

<w:pPr>
  <w:pStyle w:val="heading1" /> 
</w:pPr>

The value of the @val attribute is the ID of the associated paragraph style's styleId.

However, consider the following fragment:

<w:sdtPr>
  <w:alias w:val="SDT Title Example" />
  ...
</w:sdtPr>

In this case, the decimal number in the @val attribute is the caption of the parent structured document tag. In each case, the value is interpreted in the context of the parent element. ]

The possible values for this attribute are defined by the ST_String simple type (§2.18.89).

The following XML Schema fragment defines the contents of this element:

<complexType name="CT_String">
	<attribute name="val" type="ST_String" use="required"/>
</complexType>