Commit 28361d6e authored by Eva Huet's avatar Eva Huet
Browse files

TEI : fix enrichissements multiples

parent 21b083f2
Loading
Loading
Loading
Loading
+31 −115
Changes for xsl/tei/03-tei2html_core.xsl: 31 added lines, 115 removed lines.
Original line number Diff line number Diff line
@@ -1534,130 +1534,46 @@
                    <xsl:apply-templates/>
                </span>
            </xsl:when>
            <xsl:when test="@rend='italic'">
                <i>
                    <xsl:apply-templates/>
                </i>
            </xsl:when>
            <xsl:when test="@rend='bold'">
                <b>
                    <xsl:apply-templates/>
                </b>
            </xsl:when>
            <xsl:when test="@rend='small-caps'">
                <span style="font-variant:small-caps;">
                    <xsl:apply-templates/>
                </span>
            </xsl:when>
            <xsl:when test="@rend='sup'">
                <sup>
                    <xsl:apply-templates/>
                </sup>
            </xsl:when>
            <xsl:when test="@rend='sub'">
                <sub>
                    <xsl:apply-templates/>
                </sub>
            </xsl:when>
            <xsl:when test="@rend='underline'">
                <span style="text-decoration:underline;">
                    <xsl:apply-templates/>
                </span>
            </xsl:when>
            <xsl:when test="@rend='strikethrough'">
                <s>
                    <xsl:apply-templates/>
                </s>
            </xsl:when>
            <xsl:when test="@rend='sup strikethrough'">
                <sup>
                    <s>
                        <xsl:apply-templates/>
                    </s>                    
                </sup>
            </xsl:when>
            <xsl:when test="@rend='sub strikethrough'">
                <sub>
                    <s>
                        <xsl:apply-templates/>
                    </s>                    
                </sub>
            </xsl:when>            
            <xsl:when test="@rend='italic bold'">
                <b>
                    <i>
                        <xsl:apply-templates/>
                    </i>
                </b>
            </xsl:when>
            <xsl:when test="@rend='bold italic'">
                <b>
                    <i>
                        <xsl:apply-templates/>
                    </i>
                </b>
            </xsl:when>
            <xsl:when test="@rend='small-caps italic'">
                <i>
                    <span style="font-variant:small-caps;">
                        <xsl:apply-templates/>
                    </span>
                </i>
            <xsl:otherwise>
                <xsl:call-template name="hi-wrap">
                    <xsl:with-param name="step" select="1"/>
                </xsl:call-template>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>

    <xsl:template name="hi-wrap">
        <xsl:param name="step"/>
        <xsl:choose>
            <xsl:when test="$step = 1 and contains(@rend, 'sup')">
                <sup><xsl:call-template name="hi-wrap"><xsl:with-param name="step" select="2"/></xsl:call-template></sup>
            </xsl:when>
            <xsl:when test="@rend='small-caps bold'">
                <b>
                    <span style="font-variant:small-caps;">
                        <xsl:apply-templates/>
                    </span>
                </b>
            <xsl:when test="$step = 2 and contains(@rend, 'sub')">
                <sub><xsl:call-template name="hi-wrap"><xsl:with-param name="step" select="3"/></xsl:call-template></sub>
            </xsl:when>
            <xsl:when test="@rend='italic sup'">
                <sup>
                    <i>
                        <xsl:apply-templates/>
                    </i>
                </sup>
            <xsl:when test="$step = 3 and contains(@rend, 'bold')">
                <b><xsl:call-template name="hi-wrap"><xsl:with-param name="step" select="4"/></xsl:call-template></b>
            </xsl:when>
            <xsl:when test="@rend='sup italic'">
                <sup>
                    <i>
                        <xsl:apply-templates/>
                    </i>
                </sup>
            <xsl:when test="$step = 4 and contains(@rend, 'underline')">
                <span style="text-decoration:underline;"><xsl:call-template name="hi-wrap"><xsl:with-param name="step" select="5"/></xsl:call-template></span>
            </xsl:when>
            <xsl:when test="@rend='italic sub'">
                <sub>
                    <i>
                        <xsl:apply-templates/>
                    </i>
                </sub>
            <xsl:when test="$step = 5 and contains(@rend, 'strikethrough')">
                <s><xsl:call-template name="hi-wrap"><xsl:with-param name="step" select="6"/></xsl:call-template></s>
            </xsl:when>
            <xsl:when test="@rend='sub italic'">
                <sub>
                    <i>
                        <xsl:apply-templates/>
                    </i>
                </sub>
            <xsl:when test="$step = 6 and contains(@rend, 'italic')">
                <i><xsl:call-template name="hi-wrap"><xsl:with-param name="step" select="7"/></xsl:call-template></i>
            </xsl:when>
            <xsl:when test="@rend='italic underline'">
                <span style="text-decoration:underline;">
                    <i><xsl:apply-templates/></i>
                </span>
            <xsl:when test="$step = 7 and contains(@rend, 'small-caps')">
                <span style="font-variant:small-caps;"><xsl:call-template name="hi-wrap"><xsl:with-param name="step" select="8"/></xsl:call-template></span>
            </xsl:when>
            <xsl:when test="@rend='sup underline'">
                <sup>
                    <span style="text-decoration:underline;">
                        <xsl:apply-templates/>
                    </span>
                </sup>
            <xsl:when test="$step &lt; 8">
                <xsl:call-template name="hi-wrap">
                    <xsl:with-param name="step" select="$step + 1"/>
                </xsl:call-template>
            </xsl:when>
            <xsl:when test="@rend='sub underline'">
                <sub>
                    <span style="text-decoration:underline;">
            <xsl:otherwise>
                <xsl:apply-templates/>
                    </span>
                </sub>
            </xsl:when>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>