Skip to content
Christian Lück edited this page Oct 8, 2024 · 2 revisions

Main Text

For the main text, there are the packages

  • xsl/common/librend.xsl: defines components (modes, named templates) common to all output formats.
  • xsl/html/libtext.xsl: outputs HTML
  • xsl/latex/libtext.xsl: outputs LaTeX

Per default, this package does not do things like adding square brackets around <supplied> text. Having such brackets is considered a project-specific requirement. It can easily be done using the hooking modes text:hook-*.

Modes

  • text:text: output the main text

This main mode is defined in xsl/common/librend.xsl. There are different implementations of this package for different output formats which may support TEI's @rend and @rendition attributes or not. See librend.xsl!

Hooks

Modes, used for hooking in things. On no match, they do a deep skip, i.e., they produce no output.

  • text:hook-ahead: before any output
  • text:hook-before: before output of children, i.e., inside enclosing element
  • text:hook-after: after output of children, i.e., inside enclosing element
  • text:hook-behind: after any output, but before text:inline-marks

Named Templates

  • text:inline-marks: you probably want to override this for adding footnote marks to the text, pulling in apparatus entries, etc. See libapp.xsl!

Project specific requirements

Say, a project wants square brackets around <supplied>. To meet this requirement, add it to your XSLT:

  <xsl:use-package
    name="https://scdh.zivgitlabpages.uni-muenster.de/tei-processing/transform/xsl/html/libtext.xsl"
    package-version="1.0.0">
    <xsl:override>

   <!-- ... -->

      <xsl:template mode="text:hook-before" match="supplied">
        <xsl:text>[</xsl:text>
      </xsl:template>

      <xsl:template mode="text:hook-after" match="supplied">
        <xsl:text>]</xsl:text>
      </xsl:template>

    </xsl:override>
  </xsl:use-package>

Clone this wiki locally