Skip to content

Commit

Permalink
Added special handling for tei:orig. A patch. DCLP/dclpxsltbox#272
Browse files Browse the repository at this point in the history
  • Loading branch information
wsalesky committed Jun 5, 2017
1 parent 5b809fb commit 9205cc1
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions example-p5-xslt/tpl-apparatus.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,52 @@
</xsl:for-each>
<xsl:copy-of select="$buildup"/>
</xsl:when>
<!-- Special handling for t:orig -->
<xsl:when test="$step[self::t:orig]">
<xsl:choose>
<xsl:when test="$step/text() and not($step/*)">
<xsl:choose>
<xsl:when test="$origin='hi'">
<xsl:call-template name="trans-string">
<xsl:with-param name="trans-text">
<xsl:call-template name="string-after-space">
<xsl:with-param name="test-string" select="$step/text()"/>
</xsl:call-template>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="string-after-space">
<xsl:with-param name="test-string" select="$step/text()"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
<xsl:copy-of select="buildup"/>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="$step/node()">
<xsl:variable name="curstep-id" select="generate-id($step)"/>
<xsl:choose>
<xsl:when test="matches(., '[\s\n\r\t]')"/>
<xsl:when test="following::text()[generate-id(ancestor::node()[1])=$curstep-id and matches(., '[\s\n\r\t]')]">
<xsl:call-template name="recurse_down_back">
<xsl:with-param name="step" select="following-sibling::node()[1]"/>
<xsl:with-param name="buildup" select="buildup"/>
<xsl:with-param name="origin" select="$origin"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="recurse_down_back">
<xsl:with-param name="step" select="."/>
<xsl:with-param name="buildup" select="buildup"/>
<xsl:with-param name="origin" select="$origin"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:element name="{$step/name()}" xmlns="http://www.tei-c.org/ns/1.0">
<xsl:sequence select="$step/@*"/>
Expand Down

0 comments on commit 9205cc1

Please sign in to comment.