blob: 4a0e0028ebac4e8b9f5a750374a28821425712cf [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 Kupietz764658b2025-03-28 16:20:55 +010010 <xsl:mode streamable="yes" on-no-match="shallow-copy"/>
11 <xsl:mode streamable="no" on-no-match="shallow-copy" name="no-Streaming"/>
12 <!-- <xsl:template match="idsDoc[not(normalize-space(.//body))]"/> -->
Marc Kupietz6bcec632024-04-15 06:52:42 +020013
Marc Kupietz764658b2025-03-28 16:20:55 +010014 <!-- <xsl:template match="idsText[not(normalize-space(.//body))]"/>-->
15
16 <xsl:template match="idsText">
17 <xsl:variable name="idsText" as="node()">
18 <xsl:copy-of select="."/>
19 </xsl:variable>
20 <xsl:if test="normalize-space($idsText//body)">
21 <xsl:apply-templates select="$idsText" mode="no-Streaming"/>
22 </xsl:if>
23 </xsl:template>
24
25 <xsl:template match="hi[parent::div]" priority="0.6" mode="no-Streaming">
Marc Kupietz28f48e12024-04-14 16:17:05 +020026 <p>
Marc Kupietz764658b2025-03-28 16:20:55 +010027 <xsl:apply-templates mode="no-Streaming"/>
Marc Kupietz28f48e12024-04-14 16:17:05 +020028 </p>
29 </xsl:template>
Marc Kupietz6bcec632024-04-15 06:52:42 +020030
Marc Kupietz764658b2025-03-28 16:20:55 +010031 <xsl:template match="(ref|emph|hi|text())[parent::div]" priority="0.9" mode="no-Streaming">
Marc Kupietz958df032024-04-15 06:55:40 +020032 <p>
Marc Kupietz764658b2025-03-28 16:20:55 +010033 <xsl:apply-templates mode="no-Streaming"/>
Marc Kupietz958df032024-04-15 06:55:40 +020034 </p>
35 </xsl:template>
Marc Kupietz28f48e12024-04-14 16:17:05 +020036
Marc Kupietz764658b2025-03-28 16:20:55 +010037 <xsl:template match="p/div" mode="no-Streaming">
38 <xsl:apply-templates mode="no-Streaming"/>
Marc Kupietza6d175b2025-02-20 16:58:23 +010039 </xsl:template>
40
Marc Kupietz764658b2025-03-28 16:20:55 +010041 <xsl:template match="p/p" mode="no-Streaming">
42 <xsl:apply-templates mode="no-Streaming"/>
Marc Kupietza6d175b2025-02-20 16:58:23 +010043 </xsl:template>
44
Marc Kupietz764658b2025-03-28 16:20:55 +010045 <xsl:template match="hi[local-name(preceding-sibling::*[1]) = 'hi' and @rend = preceding-sibling::hi[1]/@rend]" mode="no-Streaming"/>
Marc Kupietz958df032024-04-15 06:55:40 +020046
Marc Kupietz764658b2025-03-28 16:20:55 +010047 <xsl:template match="hi[following-sibling::hi and not(preceding-sibling::hi)]" mode="no-Streaming">
Marc Kupietz958df032024-04-15 06:55:40 +020048 <xsl:variable name="rend" select="@rend"/>
49 <hi rend="{$rend}">
50 <xsl:for-each-group select="self|following-sibling::hi" group-adjacent="@rend=$rend">
51 <xsl:value-of select="current-group()"/>
52 </xsl:for-each-group>
53 </hi>
54 </xsl:template>
Marc Kupietz28f48e12024-04-14 16:17:05 +020055</xsl:stylesheet>