Use FO Elements and XSL Elements

This section describes how to use FO elements and XSL elements.

Use FO Elements

You can use the native FO syntax inside the Microsoft Word form fields.

For more information on XSL-FO see the W3C Website.

The full list of FO elements that Publisher supports is in Supported XSL-FO Elements.

Use XSL Elements

You can use any XSL element in the template by inserting the XSL syntax into a form field.

If you are using the basic RTF method, you cannot insert XSL syntax directly into the template. Publisher has extended the following XSL elements for use in RTF templates.

To use these in a basic-method RTF template, you must use the Publisher Tag form of the XSL element. If you are using form fields, use either option.

Apply a Template Rule

Use this element to apply a template rule to the current element's child nodes.

XSL Syntax: <xsl:apply-templates select="name">

Publisher Tag: <?apply:name?>

This function applies to <xsl:template-match="n">, where n is the element name.

Copy the Current Node

Use this element to create a copy of the current node.

XSL Syntax: <xsl:copy-of select="name">

Publisher Tag: <?copy-of:name?>

Call a Named Template

Use this element to call a named template to be inserted into or applied to the current template.

For example, use this feature to render a table multiple times.

XSL Syntax: <xsl:call-template name="name">

Publisher Tag: <?call-template:name?>

Declare a Template

Use this element to apply a set of rules when a specified node is matched.

XSL Syntax: <xsl:template name="name">

Publisher Tag: <?template:name?>

Declare a Variable

Use this element to declare a local or global variable.

XSL Syntax: <xsl:variable name="name">

Publisher Tag: <?variable:name?>


<xsl:variable name="color" select="'red'"/> 

Assigns the value red to the color variable. The variable can then be referenced in the template.

Import a Style Sheet

Use this element to import the contents of one style sheet into another.


An imported style sheet has lower precedence than the importing style sheet.

XSL Syntax: <xsl:import href="url">

Publisher Tag: <?import:url?>

Define the Root Element of the Style Sheet

This and the <xsl:stylesheet> element are completely synonymous elements. Both are used to define the root element of the style sheet.


An included style sheet has the same precedence as the including style sheet.

XSL Syntax: <xsl:stylesheet xmlns:x="url">

Publisher Tag: <?namespace:x=url?>


The namespace must be declared in the template. See Declare Namespaces.

Format Native XSL Numbers

The native XSL format-number function takes a basic format.

The basic format is:


The following list describes the parameters:

  • number - Required. Specifies the number to be formatted.

  • format - Required. Specifies the format pattern. Use the following characters to specify the pattern:

    • # (Denotes a digit. Example: ####).

    • 0 (Denotes leading and following zeros. Example: 0000.00).

    • . (The position of the decimal point Example: ###.##).

    • , (The group separator for thousands. Example: ###,###.##).

    • % (Displays the number as a percentage. Example: ##%).

    • ; (Pattern separator. The first pattern is used for positive numbers and the second for negative numbers).

  • decimalformat - Optional. For more information on the decimal format, consult any basic XSLT manual.