This question builds on the responses to my original question, where it was suggested that I post a followup. This concerns attempting to integrate the XSL code from the previous post.
In the previous question I presented a simplified version of the TEI:XML document I am transforming into HTML using XSLT 2.0 (the full tei file and current xslt can be found here https://xsltfiddle.liberty-development.net/bdxtqT/6). This is a fuller view of the hierarchy, but not all details:
<tei>
<teiHeader/>
<text>
<front/>
<body>
<p xml:lang="LA">
<seg type="typefoo" corresp="#foo601" xml:id="foo361">
<date type="deposition_date" when="1245">Idus
marcii</date>In non hendrerit metus. Sed in posuere
eros, sit amet pharetra lacus.</seg>
<seg type="typefoo" xml:id="foo362">Nullam semper varius
justo, vitae mollis turpis dapibus sit amet.
Donec<note type="public_note">note content</note>
rhoncus tempor urna sit amet imperdiet.</seg>
<seg type="typefoo" xml:id="foo363">Integer
id ante nunc. Curabitur at ligula sed arcu consequat
gravida et id orci. Morbi quis porta dolor.</seg>
<seg type="typefoo" corresp="#fooid2">Sed dictum<note
type="public_note">note content 2</note> sem nec urna sodales
cursus. Donec sit amet nibh tempor, congue ligula semper,
rhoncus odio.</seg>
</p>
</body>
<back>
<p xml:lang="EN">
<seg>
<seg>
</p>
<p xml:lang="FR">
<seg>
<seg>
</p>
</back>
</text>
<tei>
The desired HTML output is as follows. Incremental footnote numbers are created in <sup>
based on one of three conditions:
date[@type="deposition_date"]
(add footnote no.),seg[@type="typefoo"]
(add footnote no.)note[@type="public_note"]
(replace with footnote no.).
Desired output
<div>
<p>Idus marcii<sup>1</sup>In non hendrerit metus. Sed in
posuere eros, sit amet pharetra lacus.</p><sup>2</sup>
<p>Nullam semper varius justo, vitae mollis turpis
dapibus sit amet. Donec<sup>3</sup> rhoncus tempor
urna sit amet imperdiet.</p>
<p>Integer id ante nunc. Curabitur at ligula sed
arcu consequat gravida et id orci. Morbi quis porta
dolor.</p>
<p>Sed dictum sem<sup>4</sup> nec urna sodales cursus.
Donec sit amet nibh tempor, congue ligula semper,
rhoncus odio.</p><sup>5</sup>
<div>
[...]
<div>
<p><sup>1</sup> 1245</p>
<p><sup>2</sup> foo601</p>
<p><sup>3</sup> note here</p>
<p><sup>4</sup> note here</p>
<p><sup>5</sup> fooid2</p>
</div>
The full XSLT transformation document is found at https://xsltfiddle.liberty-development.net/bdxtqT/6, where one can see the following problems:
date[@type='deposition_date']
is being entirely replaced, instead receiving an added footnote markerseg[@type='dep_event' and @corresp]
is not receiving an added footnote marker, but it appears in the<div>
at the bottom of the page.
The XSL file is too long and doesn't seem to paste here correctly. Interact with files here https://xsltfiddle.liberty-development.net/bdxtqT/6.
NB: I am restricted to XSLT 2.0 as this transformation is fired off inside eXist-DB with Xquery 3.1.
Thanks very much!