Skip to content

Commit

Permalink
Merge branch 'master' into issue163
Browse files Browse the repository at this point in the history
  • Loading branch information
paregorios committed Jun 9, 2017
2 parents 5953dc9 + e737b28 commit 743fad3
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 34 deletions.
2 changes: 1 addition & 1 deletion example-p5-xslt/teiorig.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<xsl:template match="t:orig" priority="1">
<xsl:choose>
<xsl:when test="parent::t:choice"/>
<xsl:when test="parent::t:choice"><xsl:apply-templates/></xsl:when>
<xsl:otherwise>
<xsl:variable name="origChildren">
<xsl:apply-templates/>
Expand Down
66 changes: 33 additions & 33 deletions example-p5-xslt/teisupplied.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:t="http://www.tei-c.org/ns/1.0"
xmlns:EDF="http://epidoc.sourceforge.net/ns/functions"
exclude-result-prefixes="t EDF"
version="2.0">
exclude-result-prefixes="t EDF"
version="2.0">

<xsl:template match="t:supplied[@evidence='parallel']" priority="1">
<xsl:choose>
<xsl:when test="$collection = 'dclp'"><xsl:call-template name="supplied-parallel"/></xsl:when>
<xsl:otherwise><xsl:apply-templates/></xsl:otherwise>
</xsl:choose>

</xsl:template>
<xsl:template match="t:supplied[@evidence='parallel']" priority="1">
<xsl:choose>
<xsl:when test="$collection = 'dclp'"><xsl:call-template name="supplied-parallel"/></xsl:when>
<xsl:otherwise><xsl:apply-templates/></xsl:otherwise>
</xsl:choose>

<xsl:template match="t:supplied[@reason='lost']">
</xsl:template>

<xsl:template match="t:supplied[@reason='lost']">
<xsl:param name="parm-edition-type" tunnel="yes" required="no"></xsl:param>
<xsl:param name="parm-leiden-style" tunnel="yes" required="no"></xsl:param>
<xsl:param name="location" />
Expand All @@ -23,19 +23,19 @@
</xsl:if>
<xsl:choose>
<xsl:when test="@evidence = 'parallel'">
<!-- Found in [htm|txt]-teisupplied.xsl -->
<xsl:call-template name="supplied-parallel"/>
<!-- Found in [htm|txt]-teisupplied.xsl -->
<xsl:call-template name="supplied-parallel"/>
</xsl:when>
<xsl:otherwise>
<!-- *NB* the lost-opener and lost-closer templates, found in tpl-reasonlost.xsl,
<!-- *NB* the lost-opener and lost-closer templates, found in tpl-reasonlost.xsl,
are no longer used in this version of the stylesheets. They used to serve to limit
the superfluous square brackets between adjacent gap and supplied elements,
but this function is now performed by regex in [htm|txt]-tpl-sqbrackets.xsl
which is called after all other templates are completed.
-->
<xsl:text>[</xsl:text>
<xsl:choose>
<xsl:when test="$parm-edition-type = 'diplomatic'">
<xsl:when test="$parm-edition-type = 'diplomatic'">
<xsl:variable name="supplied-content">
<xsl:value-of select="descendant::text()"/>
</xsl:variable>
Expand All @@ -56,7 +56,7 @@
<xsl:text>··</xsl:text>
</xsl:for-each>
<!-- Found in teigap.xsl -->
<xsl:call-template name="dot-out">
<xsl:call-template name="dot-out">
<xsl:with-param name="cur-num" select="$sup-context-length"/>
</xsl:call-template>
<xsl:call-template name="dot-out">
Expand All @@ -72,7 +72,7 @@
<!-- function EDF:f-wwrap declared in htm-teilb.xsl; tests if lb break=no immediately follows supplied -->
<xsl:if test="EDF:f-wwrap(.) = true()">
<!-- unless this is in the app part of a choice/subst/app in ddbdp -->
<xsl:if test="(not($parm-leiden-style='ddbdp' and (ancestor::t:*[local-name()=('reg','corr','rdg') or self::t:del[parent::t:subst]]))) and (not($location = 'apparatus'))">
<xsl:if test="(not($parm-leiden-style='ddbdp' and (ancestor::t:*[local-name()=('reg','corr','rdg') or self::t:del[parent::t:subst]]))) and (not($location = 'apparatus'))">
<xsl:text>-</xsl:text>
</xsl:if>
</xsl:if>
Expand All @@ -85,42 +85,42 @@
<xsl:text>]</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

</xsl:template>

<xsl:template match="t:supplied[@reason='omitted']">

<xsl:template match="t:supplied[@reason='omitted']">
<xsl:param name="parm-edition-type" tunnel="yes" required="no"></xsl:param>
<xsl:choose>
<xsl:when test="$parm-edition-type='diplomatic'"/>
<xsl:when test="$parm-edition-type='diplomatic'"/>
<xsl:when test="@evidence = 'parallel'">
<!-- Found in [htm|txt]-teisupplied.xsl -->
<xsl:call-template name="supplied-parallel"/>
<!-- Found in [htm|txt]-teisupplied.xsl -->
<xsl:call-template name="supplied-parallel"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>&lt;</xsl:text>
<xsl:apply-templates/>
<!-- Found in tpl-cert-low.xsl -->
<xsl:call-template name="cert-low"/>
<xsl:call-template name="cert-low"/>
<xsl:text>&gt;</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:template>


<xsl:template match="t:supplied[@reason='subaudible']">
<xsl:template match="t:supplied[@reason='subaudible']">
<xsl:text>(</xsl:text>
<xsl:apply-templates/>
<xsl:call-template name="cert-low"/>
<xsl:text>)</xsl:text>
</xsl:template>

<xsl:apply-templates/>
<xsl:call-template name="cert-low"/>
<xsl:text>)</xsl:text>
</xsl:template>

<xsl:template match="t:supplied[@reason='explanation']">

<xsl:template match="t:supplied[@reason='explanation']">
<xsl:text>(i.e. </xsl:text>
<xsl:apply-templates/>
<xsl:call-template name="cert-low"/>
<xsl:text>)</xsl:text>
</xsl:template>
</xsl:template>

<xsl:template match="t:supplied[@evidence='apograph']">
<xsl:text>⌈</xsl:text>
Expand Down
23 changes: 23 additions & 0 deletions example-p5-xslt/tpl-apparatus.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,29 @@
</xsl:for-each>
<xsl:copy-of select="$buildup"/>
</xsl:when>
<!-- Special handling for t:orig -->
<xsl:when test="$step[self::t:orig[parent::t:choice]]">
<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: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 743fad3

Please sign in to comment.