Referencing Numbering Styles

To use a numbering style in a document, the paragraph properties for one or more paragraphs again specify a <numPr> element, which references a numbering definition instance via the <numId> element. The numbering definition instance itself again specifies an inherited abstract numbering definition via the <abstractNumId> element.

At this stage, the abstract numbering definition specifies that it is based on a numbering style via either of the following:

  • The abstract numbering style contains no level data, and simply specifies a reference to the numbering style's @styleId attribute via the <numStyleLink> element.

  • The abstract numbering style contains the numbering level information for the numbering style, and specifies that it is the basis for the numbering style by referencing the numbering style's @styleId attribute via the <styleLink> element.

Although the result of each method is identical, the following two examples illustrate each of the syntaxes:

Consider the first numbering style syntax, in which the numbering on a paragraph is based on an abstract numbering definition which simply references the numbering style via <numStyleLink>. The contents of the paragraph would consist of the following:

<w:p>
  <w:pPr>
    <w:numPr>
      <w:ilvl w:val="0" />
      <w:numId w:val="6" />
    </w:numPr>
  </w:pPr>
  <w:r>
    <w:t>This paragraph references a numbering style via numStyleLink.</w:t>
  </w:r>
</w:p>

The <numId> element references a numbering definition instance with a value of 6, located in the numbering part:

<w:num w:numId="6">
  <w:abstractNumId w:val="0" />
</w:num>

Based on the <abstractNumId> of 0, this instance inherits the abstract numbering definition with an @abstractNumId of 0:

<w:abstractNum w:abstractNumId="0">
  <w:nsid w:val="38901FA4" />
  <w:multiLevelType w:val="multilevel" />
  <w:numStyleLink w:val="TestNumberingStyle" />
</w:abstractNum>

This abstract numbering definition contains no numbering information - it simply notes that it inherits the numbering information from the numbering style TestNumberingStyle by referencing the @styleId attribute on that style:

<w:style w:type="numbering" w:styleId="TestNumberingStyle">
  <w:name w:val="Test Numbering Style" />
  <w:uiPriority w:val="99" />
  <w:rsid w:val="00DB3C4B" />
  <w:pPr>
    <w:numPr>
      <w:numId w:val="4" />
    </w:numPr>
  </w:pPr>
</w:style>

The style references a numbering definition instance, again via the <numId> element:

<w:num w:numId="4">
  <w:abstractNumId w:val="2" />
</w:num>

Based on the <abstractNumId> of 2, this instance inherits the abstract numbering definition with an @abstractNumId of 2:

<w:abstractNum w:abstractNumId="2">
  <w:nsid w:val="46364EB7" />
  <w:multiLevelType w:val="multilevel" />
  <w:styleLink w:val="TestNumberingStyle" />
  <w:lvl w:ilvl="0">
    <w:lvlText w:val="%1 %1 %1" />
    <w:lvlJc w:val="left" />
    <w:pPr>
      <w:tabs>
        <w:tab w:val="num" w:pos="360" />
      </w:tabs>
      <w:ind w:left="0" w:firstLine="0" />
    </w:pPr>
  </w:lvl></w:abstractNum>

This abstract numbering definition defines the properties for each level of the numbering format (levels 1 through 9 omitted for brevity). Since neither of the numbering definition instances specified overrides for level 0, the properties from abstract numbering format 2 are applied to level 0 in the resulting numbering definition instance and are applied to the text via the <ilvl> element.

Consider the second numbering style syntax, in which the numbering on a paragraph is based on an abstract numbering definition which defines the numbering information and references the numbering style via <styleLink>. The contents of the paragraph would consist of the following:

<w:p>
  <w:pPr>
    <w:numPr>
      <w:ilvl w:val="0" />
      <w:numId w:val="4" />
    </w:numPr>
  </w:pPr>
  <w:r>
    <w:t>This paragraph references a numbering style via styleLink.</w:t>
  </w:r>
</w:p>

The <numId> element references a numbering definition instance with a value of 4, located in the numbering part:

<w:num w:numId="4">
  <w:abstractNumId w:val="2" />
</w:num>

Based on the <abstractNumId> of 2, this instance inherits the abstract numbering definition with an @abstractNumId of 2:

<w:abstractNum w:abstractNumId="2">
  <w:nsid w:val="46364EB7" />
  <w:multiLevelType w:val="multilevel" />
  <w:styleLink w:val="TestNumberingStyle" />
  <w:lvl w:ilvl="0">
    <w:lvlText w:val="%1 %1 %1" />
    <w:lvlJc w:val="left" />
    <w:pPr>
      <w:tabs>
        <w:tab w:val="num" w:pos="360" />
      </w:tabs>
      <w:ind w:left="0" w:firstLine="0" />
    </w:pPr>
  </w:lvl></w:abstractNum>

This abstract numbering definition defines the properties for each level of the numbering format (levels 1 through 9 omitted for brevity) and specifies that it is the underlying numbering information for a numbering format by referencing the @styleId of that numbering style via the <styleLink> element. Since the numbering definition instances specified no override for level 0, the properties from abstract numbering format 2 are applied to level 0 in the resulting numbering definition instance and are applied to the text via the <ilvl> element.