Я разрабатываю публикацию в формате pdf с помощью xsl-fo (Saxon XSL 2.0, AHF V6.2).Как можно обработать Antennahouse Formatter ссылочные сноски?
Моя цель состоит в том, чтобы иметь пронумерованные номера (исключая дубликаты на одной странице) с вставленным текстом из статических текстовых элементов со ссылкой.
Таким образом, в основном встроенные сноски (fn) ссылаются на текстовый элемент статической сноски, создают встроенное число и печатают соответствующий сноска в нижней части страницы.
<?xml version="1.0" encoding="UTF-8"?>
<document>
<chapter>
<paragraph>some description...</paragraph>
<paragraph>some description with a footnote <fn id="fn2"/></paragraph>
<paragraph>some description with a footnote <fn id="fn2"/></paragraph>
<paragraph>some description...</paragraph>
<paragraph>some description with a footnote <fn id="fn1"/></paragraph>
</chapter>
<!-- this is a wrapper element that will not be displayed in the rendered pdf but only contains the needed information for different footnote texts -->
<chapter class="footnoteWrapper">
<footnote id="fn1">
This is the text body of footnote #1.
</footnote>
<footnote id="fn2">
This is the text body of footnote #2.
</footnote>
<footnote id="fn3">
This is the text body of footnote #3.
</footnote>
</chapter>
</document>
Повторяющиеся инлайн сноски в главе должны показать тот же номер согласно сноске они указывают на.
Это то, что результат должен выглядеть ...
Можно ли достичь этих целей с расширениями сноска AHF и ВОК: элементы сноски?
Расширения AntennaHouse Formatter доставляют странное поведение, если я использую их для подсчета fn. Они продолжают подсчитывать (1, 2, 3) вместо того, чтобы ссылаться на правильный и текущий номер указанной сноски.
Это XSL до сих пор (только соответствующий фрагмент кода):
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xs"
version="2.0">
<xsl:template match="fn[@id = //footnote/@nodeid]"
mode="content"
priority="7">
<!--+ fn link
|
| basic fn (inline) link template.
|
+-->
<xsl:apply-templates select="//footnote[@id = current()/@id]"
mode="content"/>
</xsl:template>
<xsl:template match="footnote"
mode="content"
priority="5">
<!--+ footnote
|
| basic footnote template.
|
+-->
<fo:footnote xsl:use-attribute-sets="fnt.footnote">
<fo:inline baseline-shift="super">
<axf:footnote-number id="fn_{@id}"/>
</fo:inline>
<fo:footnote-body space-after="1mm">
<fo:list-block provisional-distance-between-starts="5mm"
provisional-label-separation="2mm">
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block>
<fo:inline baseline-shift="super">
<axf:footnote-number-citation ref-id="fn_{@id}"/>
</fo:inline>
</fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>
<xsl:apply-templates mode="content"/>
</fo:block>
</fo:list-item-body>
</fo:list-item>
</fo:list-block>
</fo:footnote-body>
</fo:footnote>
</xsl:template>
</xsl:stylesheet>
Можете ли вы показать нам соответствующие XSLT у вас есть до сих пор? –