blob: ce825e61dfbf73fc6808f547aca6cce6fc827882 [file] [log] [blame]
Marc Kupietz28f48e12024-04-14 16:17:05 +02001<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
2 xmlns:saxon="http://saxon.sf.net/"
3 exclude-result-prefixes="saxon">
Marc Kupietz6bcec632024-04-15 06:52:42 +02004
Marc Kupietz28f48e12024-04-14 16:17:05 +02005 <xsl:output method="xml" indent="yes" saxon:line-length="1000"
Marc Kupietz6bcec632024-04-15 06:52:42 +02006 doctype-public="-//IDS//DTD IDS-I5 1.0//EN"
7 doctype-system="http://corpora.ids-mannheim.de/I5/DTD/i5.dtd"
8 />
9
Marc Kupietz28f48e12024-04-14 16:17:05 +020010 <xsl:mode on-no-match="shallow-copy"/>
Marc Kupietz6bcec632024-04-15 06:52:42 +020011
12 <xsl:template match="idsDoc[not(normalize-space(.//body))]"/>
13
14 <xsl:template match="idsText[not(normalize-space(.//body))]"/>
Marc Kupietz28f48e12024-04-14 16:17:05 +020015 <xsl:template match="hi[parent::div]">
16 <p>
17 <xsl:apply-templates/>
18 </p>
19 </xsl:template>
Marc Kupietz6bcec632024-04-15 06:52:42 +020020
Marc Kupietz958df032024-04-15 06:55:40 +020021 <xsl:template match="(ref|emph|hi|text())[parent::div]" priority="0.9">
22 <p>
23 <xsl:apply-templates/>
24 </p>
25 </xsl:template>
Marc Kupietz28f48e12024-04-14 16:17:05 +020026
Marc Kupietz958df032024-04-15 06:55:40 +020027 <xsl:template match="hi[local-name(preceding-sibling::*[1]) = 'hi' and @rend = preceding-sibling::hi[1]/@rend]"/>
28
29 <xsl:template match="hi[following-sibling::hi and not(preceding-sibling::hi)]">
30 <xsl:variable name="rend" select="@rend"/>
31 <hi rend="{$rend}">
32 <xsl:for-each-group select="self|following-sibling::hi" group-adjacent="@rend=$rend">
33 <xsl:value-of select="current-group()"/>
34 </xsl:for-each-group>
35 </hi>
36 </xsl:template>
Marc Kupietz28f48e12024-04-14 16:17:05 +020037</xsl:stylesheet>