Different Numbering for Equation-Figures and Figures

Here should go questions about transforming XML with XSLT and FOP.
Posts: 83

Different Numbering for Equation-Figures and Figures

Mon Apr 24, 2017 7:25 pm

We have added styles to make <equation-figure> numbers appear as EQ. instead of Figure. So now they are different in the output.

By default, Oxygen is assigning sequential numbering to both equation-figures and figures.

For example, if there is an <equation-figure>, then a figure, and then another <equation-figure> in a topic, they are numbers as follows:

<equation-figure> = EQ. 1
<figure> = Figure 2
<equation-figure> = EQ. 3

Is there a way to make Oxygen assign different sets of numbers to <equation-figure> and <figure>? So it would appear as:
<equation-figure> = EQ. 1
<figure> = Figure 1
<equation-figure> = EQ. 2
Posts: 5585

Re: Different Numbering for Equation-Figures and Figures

Tue Apr 25, 2017 9:45 pm


You will probably need extra XSLT customizations for this.
There should be an XSLT template which matches figure (and equation-figure) titles like:

Code: Select all

<xsl:template match="*[contains(@class,' topic/fig ')]/*[contains(@class,' topic/title ')]">

You can look at it and see that it uses an xsl:key to compute the current number of the figure. So you will probably need a separate xsl:key for counting the equation-figures.
The main problem is that equation-figure extends figure so you need to differentiate between these cases when computing the static text which appears before the title.

Radu Coravu
<oXygen/> XML Editor

Return to “XSLT and FOP”

Who is online

Users browsing this forum: No registered users and 2 guests