3. Style reference

About namespaces in the following sections

In the following sections, all the element names have a http://www.xmlmind.com/foconverter/xsl/extensions namespace and all attribute names have no namespace.

3.1. The styles element

The stylesheet passed as a parameter to XFC (/sty command-line option) is specified in an XML file conforming to the styles.xsd schema. The recommended extension for these XML files are ".xfc".

<styles>
Content: [ text-style | paragraph-style | numbering ]*
</styles>

Example:

<styles xmlns="http://www.xmlmind.com/foconverter/xsl/extensions"
        xmlns:xfc="http://www.xmlmind.com/foconverter/xsl/extensions">
  ...
</styles>

3.2. The text-style element

<text-style
  name = non empty token
  abstract = boolean : false
  base-style = name of another text-style
  Some standard XSL-FO text attributes
  Some standard XSL-FO background attributes
/>

Specifies a text style (also known as a “character style”) which can be applied to a fo:inline element by the means of the xfc:user-style extension attribute. Ignored if applied to any element other than fo:inline.

name

Required. Unique name of this text style.

abstract

If true, this text style is not intended to be directly applied to any fo:inline element. Instead, it is intended to be inherited by other text-style elements by the means of their base-style attributes.

base-style

Specifies another text-style element. This causes this text-style element to inherit all the XSL-FO attributes found in the base text-style element

The standard XSL-FO attributes allowed in a text-style element are:

Note that specifying any other XSL-FO attribute (e.g. text-transform) is reported as a fatal error.

Examples:

<text-style name="Basic" abstract="true" font="10pt sans-serif" />

<text-style name="Red" base-style="Basic" color="red" />

3.3. The paragraph-style element

<paragraph-style
  name = non empty token
  abstract = boolean : false
  base-style = name of another paragraph-style
  next-style = name of another paragraph-style
  numbering = name of a numbering
  numbering-level = integer between 1 and 10 inclusive
  outline-level = non empty string
  Some standard XSL-FO text attributes
  Some standard XSL-FO background attributes
  Some standard XSL-FO paragraph attributes
/>

Specifies a paragraph style which can be applied to a fo:block element by the means of the xfc:user-style extension attribute. Ignored if applied to any element other than fo:block.

name

Required. Unique name of this paragraph style.

abstract

If true, this paragraph style is not intended to be directly applied to any fo:block element. Instead, it is intended to be inherited by other paragraph-style elements by the means of their base-style attributes.

base-style

Specifies another paragraph-style element. This causes this paragraph-style element to inherit all the XSL-FO attributes and also the next-style, numbering, numbering-level and outline-level attributes found in the base paragraph-style element

next-style

Specifies the name of a paragraph-style element, this one or another one. A paragraph having next-style style will be automatically created by the word processor if the user presses key Enter inside a paragraph having this style.

numbering

Specifies that paragraphs having this style are to be automatically numbered by the word processor, the numbering scheme to be used being specified by the value of this attribute. See Section 3.4, “The numbering element”.

numbering-level

Required if numbering attribute has also been specified, but not required if this paragraph style is abstract. Specifies the list level of paragraphs having this style. See Section 3.4, “The numbering element”.

outline-level

Same extension attribute, except for the empty namespace, as Section 4.4.1, “The xfc:outline-level extension attribute”.

The standard XSL-FO attributes allowed in a paragraph-style element are:

Note that specifying any other XSL-FO attribute (e.g. padding-after, margin-left, keep-together.within-column, space-before.mininum) is reported as a fatal error.

Examples:

<paragraph-style name="Caption" base-style="Centered"
                 keep-with-previous="always"
                 font-style="oblique" font-size="smaller"
                 start-indent="4em" end-indent="4em" />

<paragraph-style name="Bullet 3" numbering="Bullets" numbering-level="3"
                 start-indent="2*24pt" />

3.4. The numbering element

<numbering
  name = non empty token
  show-all-levels = boolean : false
>
Content: [ level ]{1,10}
</numbering>

<level
  format = non empty string
  text-align = non empty string : start
  provisional-distance-between-starts = non empty string : 24pt
  provisional-label-separation = non empty string : 6pt
  Some standard XSL-FO text attributes
  Some standard XSL-FO background attributes
/>

Element numbering specifies a numbering scheme (also known as a “list style”) for use by a paragraph style. For this, the name of the numbering scheme must be referenced in the numbering attribute of element paragraph-style.

Attributes of element numbering:

name

Required. Unique name of this numbering scheme.

show-all-levels

If true, prepend to the number of a list item the numbers of all its “parent” list items. Ignored if this numbering scheme specifies bullets and not numbers.

For example, if list item "d." is “nested” inside list item "3.", itself “nested” inside list item "IV.", then the label found at the beginning of list item "d." will be in fact "IV.3.d.".

A numbering element may contain up to 10 level elements. A level element specifies a number or bullet format for a list item “nested” at the corresponding level. That is, top-level (“non-nested”) list items have a numbering level equal to 1 and their number/bullet formats are specified by the first level child of element numbering; list items “nested” inside top-level list items have a numbering level equal to 2 and their number/bullet formats are specified by the second level child of element numbering; and so on up to 10 “nesting” levels.

Attributes of element level:

format

Required. Number or bullet format specified using the syntax documented in Section 4.2.1, “The xfc:label-format extension attribute”.

text-align

Standard XSL-FO attribute text-align. Specifies the horizontal alignment of the number or bullet within the space specified using provisional-distance-between-starts.

provisional-distance-between-starts

Standard XSL-FO attribute provisional-distance-between-starts. If specified as a positive length, this gives a hanging indent to the list item.

provisional-label-separation

Standard XSL-FO attribute provisional-label-separation. Useful when provisional-distance-between-starts is 0 because it allows to separate the number or bullet from the body of the list item.

The other standard XSL-FO attributes allowed in a level element are:

Note that specifying any other XSL-FO attribute is reported as a fatal error.

Examples:

<numbering name="Bullets">
  <level format="&#x2022;" 
         provisional-label-separation="0" />
  <level format="-" 
         provisional-label-separation="0" />
  <level format="&#x25CF;"
         text-align="right" 
         provisional-distance-between-starts="48pt"
         provisional-label-separation="0" />
</numbering>

<numbering name="Numbers" show-all-levels="true">
  <level format="%{decimal}."
         font-family="sans-serif" font-weight="bold" font-size="10pt" 
         color="#800000" />
  <level format="%{lower-alpha}."
         font-family="sans-serif" font-weight="bold" font-size="10pt" 
         color="#008000" />
  <level format="-%{lower-roman}-"
         text-align="center" 
         font-family="sans-serif" font-weight="bold" font-size="10pt" 
         color="#000080" />
</numbering>

3.5. The xfc:user-style extension attribute

This extension attribute specifies which named style to use for a fo:inline or fo:block element. Example:

<fo:inline xfc:user-style="Warning">always keep your seat belt 
fastened</fo:inline>

When an ".xfc" file has been passed as a parameter to XFC, for example by the means of the /sty command-line option:

  • If set on a fo:inline element, attribute xfc:user-style must reference the name of an existing xfc:text-style element, otherwise a fatal error is reported.

  • If set on a fo:block element, attribute xfc:user-style must reference the name of an existing xfc:paragraph-style element, otherwise a fatal error is reported.

  • It's a fatal error to specify xfc:user-style on any XSL-FO element other than fo:inline and fo:block.

Attribute xfc:user-style is ignored, whatever its value, if no ".xfc" file has been passed as a parameter to XFC.

Attribute xfc:user-style="" (empty string value) is ignored in all cases.