Cross references

1. Cross referencing and numbering in xsl-fo

1.

Cross referencing and numbering in xsl-fo

???

    <xsl:key name="ids" match="*[@id]" use="@id"/>
    
    <xsl:template match="xref">
            <fo:basic-link background-color="lightblue"
    internal-destination="{@idref}">
                <xsl:for-each select="key('ids',@xrefid)">
                    <xsl:text>Fig. </xsl:text>
                        <xsl:number count="figure" level="any"
    from="mainfunc" format="1"/>
                </xsl:for-each>
            </fo:basic-link>
    </xsl:template> 
    
    <xsl:template match="figure">
      <fo:block id="{@id}" text-align="center" font-style="italic"
    keep-together.within-page="always">
        <xsl:apply-templates/>
      </fo:block>
    </xsl:template>

I *think* that's all that's needed Norma? To demonstrate how it works.

the <figure> has the id value. The key indexes them. the figure template adds them to the fo output, the xref process produces the link, with a target from the key.