[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
[Recent Entries]
[Reply To This Message]
Re: Resetting footnotes not working
Thanks very much for the tip, Toshihiko. I should have checked for an
extension. I am using AH v6.2 and the docs for this version say that it
supports axf:footnote-number-reset. But when I try to use it according
to the docs, it has no effect on the footnote numbering. I'm using it
like below, with axf:footnote-number-initial.
<fo:page-sequence force-page-count="auto"
master-reference="ditamap-body-sequence"
B B B axf:footnote-number-initial="1" axf:footnote-number-reset="page">
B B B <fo:static-content flow-name="xsl-footnote-separator">
...
Did I miss something in the use of this extension?
Thanks,
Mark
On 7/14/2023 12:15 AM, Toshihiko Makita tmakita@xxxxxxxxxxxxx wrote:
Hi Mark,
> I need to reset footnote numbers to 1 on every page.
I don't have used this extension. But have you tried this?
https://www.antenna.co.jp/AHF/help/en/ahf-ext.html#axf.footnote-number-reset
Regards,
Toshihiko Makita
Antenna House, Ina Branch.
On 2023/07/14 16:00, Mark Giffin m1879@xxxxxxxxxxxxx wrote:
I'm running XSL-FO through Antenna House to make PDF. I need to reset
footnote numbers to 1 on every page. I'm using the AH "area tree" XML
because it contains the page breaks. My examples below are
simplified. A footnote number in the input XML look like <TextArea
text="2"/>.
INPUT XML:
<AreaRoot>
B B B <PageViewportArea>
B B B B B B B ...
B B B </PageViewportArea>
B B B <PageViewportArea>
B B B B B B B <PageReferenceArea>
B B B B B B B B B B B <RegionViewportArea>
B B B B B B B B B B B B B B B <RegionReferenceArea>
B B B B B B B B B B B B B B B B B B B <MainReferenceArea>
B B B B B B B B B B B B B B B B B B B B B B B ...
B B B B B B B B B B B B B B B B B B B </MainReferenceArea>
B B B B B B B B B B B B B B B B B B B <FootnoteReferenceArea>
B B B B B B B B B B B B B B B B B B B B B B B <FootnoteArea>
B B B B B B B B B B B B B B B B B B B B B B B B B B B <BlockArea>
B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B ...
B B B B B B B B B B B B B B B B B B B B B B B B B B B </BlockArea>
B B B B B B B B B B B B B B B B B B B B B B B </FootnoteArea>
B B B B B B B B B B B B B B B B B B B B B B B <FootnoteArea>
B B B B B B B B B B B B B B B B B B B B B B B B B B B <ListBlockArea>
B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B <TextArea text="2"/>
B B B B B B B B B B B B B B B B B B B B B B B B B B B </ListBlockArea>
B B B B B B B B B B B B B B B B B B B B B B B </FootnoteArea>
B B B B B B B B B B B B B B B B B B B B B B B <FootnoteArea>
B B B B B B B B B B B B B B B B B B B B B B B B B B B <ListBlockArea>
B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B <TextArea text="3"/>
B B B B B B B B B B B B B B B B B B B B B B B B B B B </ListBlockArea>
B B B B B B B B B B B B B B B B B B B B B B B </FootnoteArea>
B B B B B B B B B B B B B B B B B B B B B B B <FootnoteArea>
B B B B B B B B B B B B B B B B B B B B B B B B B B B <ListBlockArea>
B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B <TextArea text="4"/>
B B B B B B B B B B B B B B B B B B B B B B B B B B B </ListBlockArea>
B B B B B B B B B B B B B B B B B B B B B B B </FootnoteArea>
B B B B B B B B B B B B B B B B B B B </FootnoteReferenceArea>
B B B B B B B B B B B B B B B </RegionReferenceArea>
B B B B B B B B B B B </RegionViewportArea>
B B B B B B B B B B B <RegionViewportArea>
B B B B B B B B B B B B B B B <RegionReferenceArea>
B B B B B B B B B B B B B B B B B B B <BlockArea/>
B B B B B B B B B B B B B B B </RegionReferenceArea>
B B B B B B B B B B B </RegionViewportArea>
B B B B B B B </PageReferenceArea>
B B B </PageViewportArea>
</AreaRoot>
---------------
XSLT 2.0:
<xsl:template match="@*|node()">
B B B B B B B <xsl:copy>
B B B B B B B B B B B <xsl:apply-templates select="@*|node()"/>
B B B B B B B </xsl:copy>
B B B </xsl:template>
B B B <xsl:template
match="FootnoteReferenceArea/FootnoteArea/ListBlockArea/TextArea/@text">
B B B B B B B <xsl:variable name="this-page-fns"
select="ancestor::FootnoteReferenceArea/FootnoteArea/ListBlockArea/TextArea/@text"/>
B B B B B B B <xsl:call-template name="fix-fn-num">
B B B B B B B B B B B <xsl:with-param name="footnotes" select="$this-page-fns"/>
B B B B B B B </xsl:call-template>
B B B </xsl:template>
B B B <xsl:template name="fix-fn-num">
B B B B B B B <xsl:param name="footnotes"/>
B B B B B B B <xsl:for-each select="$footnotes">
B B B B B B B B B B B <xsl:choose>
B B B B B B B B B B B B B B B <xsl:when test="position() = 1">
B B B B B B B B B B B B B B B B B B B <xsl:attribute name="text">1</xsl:attribute>
B B B B B B B B B B B B B B B </xsl:when>
B B B B B B B B B B B B B B B <xsl:when test="position() = 2">
B B B B B B B B B B B B B B B B B B B <xsl:attribute name="text">2</xsl:attribute>
B B B B B B B B B B B B B B B </xsl:when>
B B B B B B B B B B B B B B B <xsl:when test="position() = 3">
B B B B B B B B B B B B B B B B B B B <xsl:attribute name="text">3</xsl:attribute>
B B B B B B B B B B B B B B B </xsl:when>
B B B B B B B B B B B B B B B <xsl:otherwise>
B B B B B B B B B B B B B B B B B B B <xsl:attribute name="text">ERROR</xsl:attribute>
B B B B B B B B B B B B B B B </xsl:otherwise>
B B B B B B B B B B B </xsl:choose>
B B B B B B B </xsl:for-each>
B B B </xsl:template>
---------------
But the output footnotes are all the same number like this:
<RegionReferenceArea>
B B B <MainReferenceArea>
B B B B B B B ...
B B B </MainReferenceArea>
B B B <FootnoteReferenceArea>
B B B B B B B <FootnoteArea>
B B B B B B B B B B B <BlockArea>
B B B B B B B B B B B B B B B ...
B B B B B B B B B B B </BlockArea>
B B B B B B B </FootnoteArea>
B B B B B B B <FootnoteArea>
B B B B B B B B B B B <ListBlockArea>
B B B B B B B B B B B B B B B <TextArea text="3"/>
B B B B B B B B B B B </ListBlockArea>
B B B B B B B </FootnoteArea>
B B B B B B B <FootnoteArea>
B B B B B B B B B B B <ListBlockArea>
B B B B B B B B B B B B B B B <TextArea text="3"/>
B B B B B B B B B B B </ListBlockArea>
B B B B B B B </FootnoteArea>
B B B B B B B <FootnoteArea>
B B B B B B B B B B B <ListBlockArea>
B B B B B B B B B B B B B B B <TextArea text="3"/>
B B B B B B B B B B B </ListBlockArea>
B B B B B B B </FootnoteArea>
B B B </FootnoteReferenceArea>
</RegionReferenceArea>
Is there a better way to do this? I think it needs some kind of
recursion.
Thanks,
Mark
|
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format
RSS 2.0 |
|
Atom 0.3 |
|
|