xmlxsltdocxtei

My critical edition in TEI XML is not showing any footnotes in DOCX using OxGarage or TEI Stylesheets on GitHub


I have tried for days to use the Stylesheets out there and OxGarage to create a DOCX version of my TEI XML critical edition of a text. For some reason no footnotes are created at all. What am I doing wrong??

Here's the beginning of my poem, with the first line in of the first stanza. Please see the screenshot for what the .docx looks like below it:

    <?oxygen RNGSchema="http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng" type="xml"?>
    
    <TEI xmlns="http://www.tei-c.org/ns/1.0" xmlns:tei="http://www.tei-c.org/ns/1.0">
        <teiHeader>
            <fileDesc>
              ...
    </teiHeader>
        <text xml:lang="mn">
    <body>
                <pb n="11"/>
                <lb n="1"/>
                <head>
                    <app>
                        <lem wit="#KB">† Suutu Boġda Čingges Qaġan-u Gegegen-e Ergükü Öčig..</lem>
                        <rdg wit="#UB1">Boġda Činggis-ün Öčig Orosiba.</rdg>
                        <rdg wit="#UB2">Boġda Čingges-ün Öčiġ Orośibai.</rdg>
                        <rdg wit="#J"/>
                        <rdg wit="#EB">Boġda Činggis Qaġan-u Tayilġ-a-yin Öčig</rdg>
                        <rdg wit="#QL">Boġda Činggis-ün Y̌eke Öčig Orośiba - Y̌eke Öčig?</rdg>
                        <rdg wit="#ES">Boġda Činggis Qaġan-u Y̌eke Tayilġ-a-yin Öčig Orośib</rdg>
                    </app>
                </head>
                <lb n="2"/>
                <div>
                    <lg n="1">
                        <l n="1">
                            <g type="birga"/> Deger-e Tngri-yin <app>
                                <lem wit="#KB #EB">ĵay̌aġabar</lem>
                                <rdg wit="#UB1 #UB2 #J #ES" type="dialect">ĵiy̌aġabar</rdg>
                                <rdg wit="#QK">ǰay̌aḡabar</rdg>
                                <rdg wit="#Rin" type="orthographical">ǰayaġ-a-bar</rdg>
                                <rdg wit="#QL">'ay̌aġ-a-bar</rdg>
                            </app> törögsen..</l>
...

enter image description here

RANT: In general, it has been arduous to learn how to export the TEI XML document into any other form. As you can see, the Stylesheet does nothing to the critical apparatus - just prints the lemma and variant readings together in the main text! No, I have not had any formal training in Digital Humanities , but is it supposed to be this hard? I managed to dust-off my decade old programming skills to learn to export something passable for human-eyes in LaTeX/PDF and HTML, but the truth is, one needs one's work in the DOCX format to move around in some circles, and not everyone has the time to learn how to write their own XSLT for exporting to DOCX...

That said, thank you for reading this and helping out a poor soul!!!


Solution

  • In terms of the XSLT for TEI to docx, reading https://tei-c.org/release/doc/tei-xsl/profiles/default/docx/to.html I think there is a key

    <xsl:key name="FOOTNOTES" match="tei:note[tei:isFootNote(.) ]" use="1"/>
    

    which uses the function

    <xsl:function name="tei:isFootNote" as="xs:boolean">
      <xsl:param name="context"/>
      <xsl:for-each select="$context">
        <xsl:choose>
          <xsl:when test="ancestor::tei:listBibl">false</xsl:when>
          <xsl:when test="@place='foot'">true</xsl:when>
          <xsl:when test="@place='bottom'">true</xsl:when>
          <xsl:when test="@place='parend'">true</xsl:when>
          <xsl:when test="@place='tablefoot'">true</xsl:when>
          <xsl:otherwise>false</xsl:otherwise>
        </xsl:choose>
      </xsl:for-each>
    </xsl:function>
    

    and the template <xsl:template name="write-docxfile-footnotes-file"> basically with <xsl:for-each select="key('FOOTNOTES',1)"> collects and transforms anything that the above key using the above function finds.

    So based on that I would expect to see any e.g. <note place="bottom">...</note> in your input to be transformed to footnotes. But you don't have any such elements at all, at least judging from that snippet you have shown.

    I don't know whether that is any help, TEI seems a rich and powerful but therefore complex XML application which has various ways to structure, mark up and express things, I don't know whether the TEI to docx XSLT caters for various approaches, my (superficial) reading of the XSLT suggests your input XML needs tei:note elements with a place attribute of values like foot, bottom or the other values mapped to true in that function, if you expect anything to show up as footnotes in docx.