Skip to content

Commit

Permalink
[tei2folia] implemented support for tei:c element
Browse files Browse the repository at this point in the history
  • Loading branch information
proycon committed Oct 8, 2021
1 parent 53a9dbb commit 2bdd382
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions foliatools/tei2folia.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ Heavily adapted by Maarten van Gompel (Radboud University)
<annotator processor="proc.tei2folia.xsl"/>
</sentence-annotation>
</xsl:if>
<xsl:if test="//tei:w">
<xsl:if test="//tei:w|//tei:c">
<token-annotation>
<annotator processor="proc.tei2folia.xsl"/>
</token-annotation>
Expand Down Expand Up @@ -270,7 +270,7 @@ Heavily adapted by Maarten van Gompel (Radboud University)
<xsl:template name="textandorstructure">
<xsl:variable name="hastext"><xsl:choose><xsl:when test="normalize-space(translate(., '&#160;', ' ')) != ''">1</xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:variable>
<xsl:variable name="hasmarkup"><xsl:choose><xsl:when test="tei:hi|tei:add|tei:name|tei:note|tei:corr|tei:supplied|tei:add|tei:l and number($hastext) = 1">1</xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:variable>
<xsl:variable name="hasstructure"><xsl:choose><xsl:when test="tei:p|tei:div|tei:s|tei:w|tei:fw|tei:pc|tei:lg|tei:sp|tei:table|tei:row|tei:cell|tei:figure|tei:list|tei:item|tei:cell|tei:speaker|tei:head">1</xsl:when><xsl:when test="number($hasmarkup = 1) and .//tei:w[1]|.//tei:s[1]|.//tei:p[1]">1</xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:variable>
<xsl:variable name="hasstructure"><xsl:choose><xsl:when test="tei:p|tei:div|tei:s|tei:w|tei:c|tei:fw|tei:pc|tei:lg|tei:sp|tei:table|tei:row|tei:cell|tei:figure|tei:list|tei:item|tei:cell|tei:speaker|tei:head">1</xsl:when><xsl:when test="number($hasmarkup = 1) and .//tei:w[1]|.//tei:c[1]|.//tei:s[1]|.//tei:p[1]">1</xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:variable>

<!--<xsl:comment>DEBUG:<xsl:value-of select="$hasstructure" /><xsl:value-of select="$hastext" /><xsl:value-of select="$hasmarkup" /></xsl:comment>-->

Expand Down Expand Up @@ -466,7 +466,7 @@ Heavily adapted by Maarten van Gompel (Radboud University)
<xsl:call-template name="s"/>
</xsl:template>

<xsl:template match="tei:w|tei:fw|tei:pc" mode="structure">
<xsl:template match="tei:w|tei:c|tei:fw|tei:pc" mode="structure">
<xsl:call-template name="w"/>
</xsl:template>

Expand Down Expand Up @@ -537,7 +537,7 @@ Heavily adapted by Maarten van Gompel (Radboud University)
<item>
<xsl:attribute name="n"><xsl:value-of select="string(preceding-sibling::*[1])" /></xsl:attribute>
<xsl:choose>
<xsl:when test="tei:list|tei:table|tei:p|tei:s|tei:w|tei:fw">
<xsl:when test="tei:list|tei:table|tei:p|tei:s|tei:w|tei:c|tei:fw">
<xsl:if test="normalize-space(translate(string(preceding-sibling::*[1]) ,'&#160;', ' '))">
<gap class="label">
<content><xsl:value-of select="string(preceding-sibling::*[1])" /></content>
Expand Down Expand Up @@ -654,7 +654,7 @@ Heavily adapted by Maarten van Gompel (Radboud University)

<xsl:template match="tei:hi" mode="structure">
<xsl:choose>
<xsl:when test=".//tei:w[1]|.//tei:s[1]|.//tei:p[1]">
<xsl:when test=".//tei:w[1]|.//tei:c[1]|.//tei:s[1]|.//tei:p[1]">
<!-- styling is wrapped around structural elements, FoLiA requires the reverse -->
<xsl:if test="$quiet = 'false'">
<xsl:message terminate="no">[tei2folia WARNING] styling wrapped around structural elements can not be converted yet (reduced to a comment)</xsl:message>
Expand Down

0 comments on commit 2bdd382

Please sign in to comment.