Skip to content

Commit

Permalink
html fixes: create plain text lemmas and prevent duplicate ids in app…
Browse files Browse the repository at this point in the history
…aratus entries
  • Loading branch information
peterstadler committed Oct 10, 2016
1 parent 5b6f0ca commit c18b08d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 11 deletions.
34 changes: 24 additions & 10 deletions xsl/apparatus.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@
<!-- Need to take care of whitespace when there are multiple <add> -->
<xsl:choose>
<xsl:when test="count(tei:add) gt 1">
<xsl:apply-templates select="tei:add | text()"/>
<xsl:apply-templates select="tei:add | text()" mode="#current"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="tei:add"/>
<xsl:apply-templates select="tei:add" mode="#current"/>
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="popover"/>
Expand All @@ -120,10 +120,10 @@
<!-- Need to take care of whitespace when there are multiple <add> -->
<xsl:choose>
<xsl:when test="count(tei:add) gt 1">
<xsl:apply-templates select="tei:add | text()"/>
<xsl:apply-templates select="tei:add | text()" mode="plain-text-output"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="tei:add"/>
<xsl:apply-templates select="tei:add" mode="plain-text-output"/>
</xsl:otherwise>
</xsl:choose>
<xsl:text>": </xsl:text>
Expand Down Expand Up @@ -172,7 +172,7 @@
<xsl:attribute name="class">
<xsl:text>tei_app</xsl:text>
</xsl:attribute>
<xsl:apply-templates select="tei:lem"/>
<xsl:apply-templates select="tei:lem" mode="#current"/>
<xsl:call-template name="popover"/>
</xsl:element>
</xsl:template>
Expand Down Expand Up @@ -339,7 +339,7 @@
<xsl:attribute name="class" select="'tei_choice'"/>
<xsl:choose>
<xsl:when test="tei:sic">
<xsl:apply-templates select="tei:corr"/>
<xsl:apply-templates select="tei:corr" mode="#current"/>
</xsl:when>
<xsl:when test="tei:unclear">
<xsl:variable name="opts" as="element()*">
Expand Down Expand Up @@ -400,7 +400,7 @@
<xsl:element name="span">
<xsl:apply-templates select="@xml:id"/>
<xsl:attribute name="class" select="concat('tei_', local-name())"/>
<xsl:apply-templates/>
<xsl:apply-templates mode="#current"/>
<xsl:call-template name="popover"/>
</xsl:element>
</xsl:template>
Expand All @@ -410,7 +410,7 @@
<xsl:attribute name="class" select="concat('tei_', local-name())"/>
<xsl:attribute name="id" select="wega:createID(.)"/>
<xsl:text>[</xsl:text>
<xsl:apply-templates/>
<xsl:apply-templates mode="#current"/>
<xsl:text>]</xsl:text>
</xsl:element>
</xsl:template>
Expand All @@ -423,7 +423,7 @@
<xsl:value-of select="local-name()"/>
</xsl:attribute>
<xsl:text>"</xsl:text>
<xsl:apply-templates/>
<xsl:apply-templates mode="plain-text-output"/>
<xsl:text>": sic!</xsl:text>
</xsl:element>
</xsl:template>
Expand All @@ -449,7 +449,7 @@
<xsl:value-of select="local-name()"/>
</xsl:attribute>
<xsl:text>"</xsl:text>
<xsl:apply-templates/>
<xsl:apply-templates mode="plain-text-output"/>
<xsl:text>": </xsl:text>
<xsl:choose>
<xsl:when test="tei:gap">
Expand All @@ -467,6 +467,20 @@
</xsl:choose>
</xsl:element>
</xsl:template>

<xsl:template match="tei:del" mode="plain-text-output"/>
<xsl:template match="tei:note" mode="plain-text-output"/>
<xsl:template match="tei:lb" mode="plain-text-output">
<xsl:text> </xsl:text>
</xsl:template>
<xsl:template match="tei:q" mode="plain-text-output">
<xsl:text>"</xsl:text>
<xsl:apply-templates mode="#current"/>
<xsl:text>"</xsl:text>
</xsl:template>
<xsl:template match="tei:*" mode="plain-text-output">
<xsl:apply-templates mode="#current"/>
</xsl:template>

<xsl:function name="wega:createID">
<xsl:param name="elem" as="element()"/>
Expand Down
2 changes: 1 addition & 1 deletion xsl/document.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
</xsl:element>
</xsl:template>

<xsl:template match="tei:head[not(ancestor::tei:floatingText)]" priority="1">
<xsl:template match="tei:head[parent::tei:div]" priority="1">
<xsl:variable name="minHeadLevel" as="xs:integer" select="2"/>
<xsl:variable name="increments" as="xs:integer">
<!-- Wenn es ein Untertitel ist wird der Level hochgezählt -->
Expand Down

0 comments on commit c18b08d

Please sign in to comment.