Using FO Elements and XSL Elements

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

Using 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 at http://www.w3.org/2002/08/XSLFOsummary.html

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

Using 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. BI 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 BI Publisher Tag form of the XSL element. If you are using form fields, use either option.

Applying 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">

BI Publisher Tag: <?apply:name?>

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

Copying the Current Node

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

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

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

Calling 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">

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

Declaring a Template

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

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

BI Publisher Tag: <?template:name?>

Declaring a Variable

Use this element to declare a local or global variable.

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

BI Publisher Tag: <?variable:name?>

Example:

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

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

Importing a Style Sheet

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

Note:

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

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

BI Publisher Tag: <?import:url?>

Defining 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.

Note:

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

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

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

Note:

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

Formatting Native XSL Numbers

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

The basic format is:

format-number(number,format,[decimalformat])

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.