Skip to content

Commit 805fbe0

Browse files
committed
ms join shows multiple ranges of citedRange of referenced ms
1 parent 3d2431d commit 805fbe0

1 file changed

Lines changed: 42 additions & 13 deletions

File tree

src/main/xar-resources/resources/xsl/majlis.xsl

Lines changed: 42 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2406,20 +2406,49 @@
24062406
<xsl:value-of select="t:idno"/>
24072407
</xsl:otherwise>
24082408
</xsl:choose>
2409-
<!-- only do anything if t:citedRange has non-blank content -->
2410-
<xsl:if
2411-
test="string-length(normalize-space(t:citedRange)) &gt; 0">
2412-
<xsl:choose>
2413-
<xsl:when
2414-
test="t:citedRange[contains(., '-')] or t:citedRange[contains(., '–')]">
2415-
<xsl:text>, fols. </xsl:text>
2416-
</xsl:when>
2417-
<xsl:otherwise>
2418-
<xsl:text>, fol. </xsl:text>
2419-
</xsl:otherwise>
2420-
</xsl:choose>
2409+
<!--
2410+
MANUSCRIPT JOIN ONLY: render the citedRange folio reference(s).
2411+
Reads BOTH the text value AND @from/@to so no data is missed:
2412+
prefer the citedRange text; if it is empty, build the value
2413+
from @from/@to. Handles multiple citedRanges (comma-separated)
2414+
and recognises hyphen / en dash / em dash when deciding
2415+
fol. vs fols.
2416+
-->
2417+
<!--
2418+
citedRanges that carry data in either the text or @from
2419+
-->
2420+
<xsl:variable name="mjCitedRanges"
2421+
select="t:citedRange[normalize-space(.) != '' or normalize-space(@from) != '']"/>
2422+
<xsl:if test="exists($mjCitedRanges)">
2423+
<!--
2424+
plural 'fols.' if any range spans (a dash in the text,
2425+
or @to differs from @from), or there is more than one range
2426+
-->
2427+
<xsl:variable name="mjAnyRange" select="
2428+
some $c in $mjCitedRanges
2429+
satisfies (contains($c, '-') or contains($c, '–') or contains($c, '—')
2430+
or (normalize-space($c/@to) != '' and $c/@to != $c/@from))"/>
2431+
<xsl:value-of
2432+
select="if ($mjAnyRange or count($mjCitedRanges) gt 1) then ', fols. ' else ', fol. '"/>
2433+
<xsl:for-each select="$mjCitedRanges">
2434+
<xsl:if test="position() gt 1">, </xsl:if>
2435+
<!--
2436+
prefer the text value; fall back to @from/@to so an
2437+
attribute-only citedRange is not dropped
2438+
-->
2439+
<xsl:choose>
2440+
<xsl:when test="normalize-space(.) != ''">
2441+
<xsl:value-of select="normalize-space(.)"/>
2442+
</xsl:when>
2443+
<xsl:when test="normalize-space(@to) != '' and @to != @from">
2444+
<xsl:value-of select="concat(@from, '–', @to)"/>
2445+
</xsl:when>
2446+
<xsl:when test="normalize-space(@from) != ''">
2447+
<xsl:value-of select="@from"/>
2448+
</xsl:when>
2449+
</xsl:choose>
2450+
</xsl:for-each>
24212451
</xsl:if>
2422-
<xsl:value-of select="t:citedRange"/>
24232452
</p>
24242453
</xsl:for-each>
24252454
</div>

0 commit comments

Comments
 (0)