| Marc Kupietz | 28f48e1 | 2024-04-14 16:17:05 +0200 | [diff] [blame] | 1 | <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 Kupietz | 6bcec63 | 2024-04-15 06:52:42 +0200 | [diff] [blame] | 4 | |
| Marc Kupietz | 28f48e1 | 2024-04-14 16:17:05 +0200 | [diff] [blame] | 5 | <xsl:output method="xml" indent="yes" saxon:line-length="1000" |
| Marc Kupietz | 6bcec63 | 2024-04-15 06:52:42 +0200 | [diff] [blame] | 6 | doctype-public="-//IDS//DTD IDS-I5 1.0//EN" |
| 7 | doctype-system="http://corpora.ids-mannheim.de/I5/DTD/i5.dtd" |
| 8 | /> |
| 9 | |
| Marc Kupietz | 28f48e1 | 2024-04-14 16:17:05 +0200 | [diff] [blame] | 10 | <xsl:mode on-no-match="shallow-copy"/> |
| Marc Kupietz | 6bcec63 | 2024-04-15 06:52:42 +0200 | [diff] [blame] | 11 | |
| 12 | <xsl:template match="idsDoc[not(normalize-space(.//body))]"/> |
| 13 | |
| 14 | <xsl:template match="idsText[not(normalize-space(.//body))]"/> |
| Marc Kupietz | 33d1128 | 2024-04-19 19:22:16 +0200 | [diff] [blame] | 15 | <xsl:template match="hi[parent::div]" priority="0.6"> |
| Marc Kupietz | 28f48e1 | 2024-04-14 16:17:05 +0200 | [diff] [blame] | 16 | <p> |
| 17 | <xsl:apply-templates/> |
| 18 | </p> |
| 19 | </xsl:template> |
| Marc Kupietz | 6bcec63 | 2024-04-15 06:52:42 +0200 | [diff] [blame] | 20 | |
| Marc Kupietz | 958df03 | 2024-04-15 06:55:40 +0200 | [diff] [blame] | 21 | <xsl:template match="(ref|emph|hi|text())[parent::div]" priority="0.9"> |
| 22 | <p> |
| 23 | <xsl:apply-templates/> |
| 24 | </p> |
| 25 | </xsl:template> |
| Marc Kupietz | 28f48e1 | 2024-04-14 16:17:05 +0200 | [diff] [blame] | 26 | |
| Marc Kupietz | 958df03 | 2024-04-15 06:55:40 +0200 | [diff] [blame] | 27 | <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 Kupietz | 28f48e1 | 2024-04-14 16:17:05 +0200 | [diff] [blame] | 37 | </xsl:stylesheet> |