TEIC / Stylesheets

TEI XSL Stylesheets
231 stars 124 forks source link

overridability for docxtotei #524

Closed eduarddrenth closed 11 months ago

eduarddrenth commented 2 years ago

docxtotei offers a construct based on style names starting with "TEI " or "tei_".

This PR enables developers to write threir own elementFromStyle template for example to solve style naming problems or to add custom markup.

See: https://bitbucket.org/fryske-akademy/jurisprudentia-frisica/src/master/customDocxToTei.xsl

bwbohl commented 1 year ago

I really like this because it makes the customisation of the processTextrun template much easier. In my current work context, I had a similar situation where it was good to provide a custom prefix for the docx style templates. In my case, I introuced my own template processTextrun, which would match my prefix and otherwise xsl:next-match:

<xsl:template name="processTextrun">
    <xsl:variable name="style">
        <xsl:value-of select="w:rPr/w:rStyle/@w:val"/>
    </xsl:variable>
    <xsl:choose>
        <xsl:when test="starts-with($style,'CUSTOM ')">
            <!-- do something -->
        </xsl:when>
        <xsl:otherwise>
            <xsl:next-match/>
        </xsl:otherwise>
    </xsl:choose>
</xsl:template>
sydb commented 1 year ago

Ack! Thank you, @bwbohl. I had not realized (or forgot?) that I was supposed to review this. Will try to take a more careful look over the weekend. @eduarddrenth (or @HelenaSabel) — feel free to poke me if I have not said anything by middle of next week.

eduarddrenth commented 1 year ago

Great, some activity here....perhaps also look at #586...