これは、私が抱えている問題の一般的な構造を明らかにする単純化された XML です。
<chapter num="07">
<title>
<page num="703"/>
... text (mixed content) ...
</title>
<page num="704"/>
<section level="sect1">
<title>...text...</title>
<para num="7.1.1">... a lot of text (mixed content)...</para>
</section>
<section level="sect1">
<title>... text... </title>
<para num="7.2.1">Some text...
<footnoteref linkend="fn3" num="3"/>
<footnote num="3" id="fn3"> ... mixed content ...</footnote>
...more text...
</para>
<page num="705"/>
<section level="sect2">
<title>...</title>
<para num="7.2.2">... text ...
<footnoteref linkend="fn4" num="4"/>
<footnote num="4" id="fn4">...</footnote>
... more text ...
<footnoteref linkend="fn5" num="5"/>
<footnote num="5" id="fn5">...</footnote>
... more text ...
</para>
<para num="7.2.5">...
<page num="706"/>...
<footnoteref linkend="fn6" num="6"/>
<footnote num="6" id="fn6"> ... </footnote>
</para>
<para num="7.2.6">... some text
<footnoteref linkend="fn7" num="7"/>
<footnote num="7" id="fn7"> ... </footnote>
</para>
</section>
</section>
</chapter>
最後の先行する最初の一致する前に、1つの処理命令<?pb label='
ページ番号を配置する必要があります。1 回だけ表示され、ページ番号は最後に表示された要素の属性の値と同じである必要があります。'?>
<footnote>
<page>
num
<page>
たとえば、上記のソースを処理すると、結果ドキュメントでの直前、脚注 4 と 5 のグループ化)、直前の1 つ(脚注6と 7 のグループ化) が生成されると予想されます。要素を処理するためのテンプレートがあり、それらは各ページの最後に一緒に配置され、前に処理命令が続きます (要素はそのまま残ります)。<?pb label='704'?>
<footnote num="3">
<?pb label='705'?>
<footnote num="4">
<?pb label='706'?>
<footnote num="6">
<footnote>
<footnoteref>
私の XSL はこちらです。大きすぎるので、ここには貼り付けられません。
脚注処理命令 (pb ラベル) に重複があります。footnote
最後のタグに続く最初のタグの前にのみ pblabel が必要page
です。と合わせてみましpreceding::page
たが、うまくいきませんでした。同じ処理命令が複数回繰り返されています。たとえば、<?pb label='706'?>
次footnote 6
の最初footnote
のpage 706
.