4. A comprehensive example

A comprehensive example demonstrating almost everything you can do with named styles is found in XFC_install_dir/samples/styles.fo:

...
<fo:block xfc:user-style="Heading 1">This is a block 
having xfc:user-style="Heading 1".</fo:block>
...

The associated style definition file is XFC_install_dir/samples/styles.xfc:

...
<numbering name="Heading Numbering" show-all-levels="true">1
  <level format="%{decimal}." 
         provisional-distance-between-starts="0" 
         provisional-label-separation="8pt"/>
  <level format="%{decimal}." 
         provisional-distance-between-starts="0" 
         provisional-label-separation="7pt" />
  <level format="%{decimal}." 
         provisional-distance-between-starts="0" 
         provisional-label-separation="6pt" />
</numbering>

<paragraph-style name="Heading" abstract="true" next-style="Paragraph"2
                 numbering="Heading Numbering"3
                 keep-with-next="always"
                 font-family="sans-serif" font-weight="bold" 
                 color="#004080" />

<paragraph-style name="Heading 1" base-style="Heading"4 
                 outline-level="1"5 numbering-level="1"6
                 font-size="16pt" line-height="0.82em" 
                 space-before="0.82em" space-after="0.82em" />
...

1

Specifies the numbering, up to 3 levels, of the headings found in the generated word processor file.

2

This is an abstract paragraph-style which is inherited by the "Heading 1", "Heading 2" and "Heading 3" actual paragraph-styles.

3

This specifies how headings are to be automatically numbered by the word processor.

4

A "Heading 1" paragraph-style which is applied to all first level headings.

5

This specifies the outline level of a "Heading 1".

6

This specifies the list level, that is, which level child element of the numbering element, applies to a "Heading 1".

You can generate styles.odt, styles.rtf, styles.word.xml, styles.docx by running make_samples inside the XFC_install_dir/samples/ folder.