|
118 | 118 | <xsl:with-param name="part"><xsl:value-of select="$part3" /></xsl:with-param>
|
119 | 119 | <xsl:with-param name="pos">first</xsl:with-param>
|
120 | 120 | </xsl:call-template></xsl:when>
|
121 |
| - <xsl:when test="contains($part3, ' : ')"><xsl:value-of select="substring-before($part3, ' :')"/></xsl:when> |
| 121 | + <xsl:when test="contains($part3, ' : ') and lem/@resp"><xsl:value-of select="substring-before($part3, ' :')"/></xsl:when> |
122 | 122 | <xsl:otherwise>Current edition</xsl:otherwise>
|
123 | 123 | </xsl:choose>
|
124 | 124 |
|
|
240 | 240 | <xsl:with-param name="obf" select="normalize-space($titleagg)"/>
|
241 | 241 | </xsl:call-template>
|
242 | 242 | </xsl:variable>
|
243 |
| - <xsl:attribute name="title" select="$title"/> |
| 243 | + <xsl:attribute name="title"><xsl:apply-templates select="$title" mode="sqbrackets"/></xsl:attribute> |
244 | 244 | <!-- <xsl:if test="$apptype = ('appbl')"> and $childtype != ''"> 'siccorr', 'subst', 'origreg', 'appalt' and $childtype='subst'"> -->
|
245 | 245 | <xsl:value-of select="normalize-space(replace(replace($part1, 'FNORD(\S)*', ''), '\(\*\)', ''))"/>
|
246 | 246 | <xsl:if test="normalize-space($part1) != '' and (not(ends-with(normalize-space($part1), ','))) and (not(ends-with(normalize-space($part1), '.')))">,</xsl:if> <!-- --><xsl:text> </xsl:text><xsl:value-of select="normalize-space(replace(replace($part3, 'FNORD(\S)*', ''), '\(\*\)', ''))"/>
|
|
351 | 351 | <!-- Used by: txPtchild, appcontent, teiaddanddel.xsl#t:add -->
|
352 | 352 | <xsl:param name="addpath" select="''"/>
|
353 | 353 | <xsl:param name="delpath"/><xsl:choose>
|
354 |
| - <!-- Old encoding: (stil supported) --> |
| 354 | + <!-- Old encoding: (still supported) --> |
355 | 355 | <xsl:when test="(
|
356 | 356 | not(preceding-sibling::node())
|
357 | 357 | or matches(preceding-sibling::node()[1][self::text()], '[\s\n\r\t]')
|
|
662 | 662 | </xsl:choose>
|
663 | 663 | </xsl:template>
|
664 | 664 |
|
665 |
| - |
666 |
| - |
| 665 | + <!-- The recurse_* templates handle isolating the piece of text that will be printed in the apparatus, |
| 666 | + by finding the word breaks before and after it.--> |
667 | 667 | <xsl:template name="recurse_back">
|
668 |
| - <!-- Recurse trhough preceding sibling nodes until a space or carriage return is found --> |
| 668 | + <!-- Recurse through preceding sibling nodes until a space or carriage return is found --> |
669 | 669 | <!-- Used by hirend, appcontent -->
|
670 | 670 | <!-- When used by hirend ($origin='hi'), will strip diacritics -->
|
671 | 671 | <xsl:param name="step"/>
|
|
681 | 681 | <xsl:when test="$step[self::text()]">
|
682 | 682 | <xsl:choose>
|
683 | 683 | <xsl:when test="matches($step, '[\s\n\r\t]')">
|
684 |
| - <xsl:copy-of select="$buildup"/> |
| 684 | + <xsl:choose> |
| 685 | + <xsl:when test="string-length($buildup) = 0"> |
| 686 | + <xsl:choose> |
| 687 | + <xsl:when test="$origin='hi'"> |
| 688 | + <xsl:call-template name="trans-string"> |
| 689 | + <xsl:with-param name="trans-text"> |
| 690 | + <xsl:call-template name="string-after-space"> |
| 691 | + <xsl:with-param name="test-string" select="$step"/> |
| 692 | + </xsl:call-template> |
| 693 | + </xsl:with-param> |
| 694 | + </xsl:call-template> |
| 695 | + </xsl:when> |
| 696 | + <xsl:otherwise> |
| 697 | + <xsl:call-template name="string-after-space"> |
| 698 | + <xsl:with-param name="test-string" select="$step"/> |
| 699 | + </xsl:call-template> |
| 700 | + </xsl:otherwise> |
| 701 | + </xsl:choose> |
| 702 | + </xsl:when> |
| 703 | + <xsl:otherwise><xsl:copy-of select="$buildup"/></xsl:otherwise> |
| 704 | + </xsl:choose> |
685 | 705 | </xsl:when>
|
686 | 706 | <!-- if the text node is a first child and a space hasn't been located yet... -->
|
687 | 707 | <xsl:when test="not($step/preceding-sibling::node()[1])">
|
|
780 | 800 | <xsl:with-param name="origin" select="$origin"/>
|
781 | 801 | </xsl:call-template>
|
782 | 802 | </xsl:variable>
|
783 |
| - <xsl:apply-templates select="$builddown"/> |
| 803 | + <xsl:apply-templates select="$builddown/node()"/> |
784 | 804 | <xsl:copy-of select="$buildup"/>
|
785 | 805 | </xsl:when>
|
786 | 806 | <xsl:otherwise>
|
|
812 | 832 | <xsl:template name="recurse_down_back">
|
813 | 833 | <!-- Recurse through child nodes until a space or carriage return is found. Re-create elements when necessary -->
|
814 | 834 | <!-- Used by recurse_back -->
|
815 |
| - <!-- Handles buidlup for right-to-left space/return search --> |
| 835 | + <!-- Handles buildup for right-to-left space/return search --> |
816 | 836 | <xsl:param name="step"/>
|
817 | 837 | <xsl:param name="buildup"/>
|
818 | 838 | <xsl:param name="origin"/>
|
|
871 | 891 | <xsl:variable name="curstep-id" select="generate-id($step)"/>
|
872 | 892 | <xsl:choose>
|
873 | 893 | <xsl:when test="matches(., '[\s\n\r\t]')"/>
|
874 |
| - <xsl:when test="for $i in following::text()[generate-id(ancestor::node()[1])=$curstep-id] |
875 |
| - return |
876 |
| - if (matches($i, '[\s\n\r\t]')) |
877 |
| - then false() |
878 |
| - else true()"> |
| 894 | + <xsl:when test="following::text()[generate-id(ancestor::node()[1])=$curstep-id and matches(., '[\s\n\r\t]')]"> |
879 | 895 | <xsl:call-template name="recurse_down_back">
|
880 | 896 | <xsl:with-param name="step" select="following-sibling::node()[1]"/>
|
881 | 897 | <xsl:with-param name="buildup" select="buildup"/>
|
|
899 | 915 | </xsl:template>
|
900 | 916 |
|
901 | 917 | <xsl:template name="recurse_forward">
|
902 |
| - <!-- Recurse trhough following sibling nodes until a space or carriage return is found --> |
| 918 | + <!-- Recurse through following sibling nodes until a space or carriage return is found --> |
903 | 919 | <!-- Used by hirend, appcontent -->
|
904 | 920 | <xsl:param name="step"/>
|
905 | 921 |
|
|
1014 | 1030 | </xsl:call-template>
|
1015 | 1031 | </xsl:when>
|
1016 | 1032 | <xsl:when test="($step[self::text] or $step[self::*]) and matches($step, '[\s\n\r\t]')">
|
1017 |
| - <xsl:variable name="buildown"> |
| 1033 | + <xsl:variable name="builddown"> |
1018 | 1034 | <xsl:call-template name="recurse_down">
|
1019 | 1035 | <xsl:with-param name="step" select="$step"/>
|
1020 | 1036 | <xsl:with-param name="origin" select="$origin"/>
|
1021 | 1037 | </xsl:call-template>
|
1022 | 1038 | </xsl:variable>
|
1023 | 1039 | <xsl:variable name="resolve">
|
1024 |
| - <xsl:apply-templates select="$buildown"/> |
| 1040 | + <xsl:apply-templates select="$builddown/node()"/> |
1025 | 1041 | </xsl:variable>
|
1026 | 1042 | <xsl:value-of select="$resolve"/>
|
1027 | 1043 | </xsl:when>
|
|
1072 | 1088 | <xsl:element name="{$step/name()}" xmlns="http://www.tei-c.org/ns/1.0">
|
1073 | 1089 | <xsl:sequence select="$step/@*"/>
|
1074 | 1090 | <xsl:choose>
|
| 1091 | + <xsl:when test="local-name($step/node()[1]) = '' and matches($step/node()[1], '[\s\t\r\n]')"> |
| 1092 | + <xsl:choose> |
| 1093 | + <xsl:when test="$origin='hi'"> |
| 1094 | + <xsl:call-template name="trans-string"> |
| 1095 | + <xsl:with-param name="trans-text"> |
| 1096 | + <xsl:call-template name="string-before-space"> |
| 1097 | + <xsl:with-param name="test-string" select="$step/node()[1]"/> |
| 1098 | + </xsl:call-template> |
| 1099 | + </xsl:with-param> |
| 1100 | + </xsl:call-template> |
| 1101 | + </xsl:when> |
| 1102 | + <xsl:otherwise> |
| 1103 | + <xsl:call-template name="string-before-space"> |
| 1104 | + <xsl:with-param name="test-string" select="$step/node()[1]"/> |
| 1105 | + </xsl:call-template> |
| 1106 | + </xsl:otherwise> |
| 1107 | + </xsl:choose> |
| 1108 | + </xsl:when> |
1075 | 1109 | <xsl:when test="$step/text() and not($step/*)">
|
1076 | 1110 | <xsl:choose>
|
1077 | 1111 | <xsl:when test="$origin='hi'">
|
|
1352 | 1386 | </xsl:template>
|
1353 | 1387 |
|
1354 | 1388 | <xsl:template name="trans-string">
|
1355 |
| - <!-- transforms context of <hi> into lowercase unaccented for rendering in app --> |
| 1389 | + <!-- transforms context of <hi> into lowercase unaccented for rendering in app --> |
1356 | 1390 | <xsl:param name="trans-text" select="."/>
|
1357 |
| - <xsl:value-of select="translate($trans-text, $all-grc, $grc-lower-strip)"/> |
| 1391 | + <xsl:value-of select="translate($trans-text, $all-grc, $grc-lower-strip)"/> |
1358 | 1392 | </xsl:template>
|
1359 | 1393 |
|
1360 | 1394 | <xsl:template name="childCertainty">
|
|
1367 | 1401 | <xsl:template name="support">
|
1368 | 1402 | <!-- called by template "hirend" above; decides whether text support is "ostrakon" or other (prob. = "papyrus") -->
|
1369 | 1403 | <xsl:choose>
|
1370 |
| - <xsl:when test="starts-with(//t:idno[@type='filename'],'o.')"> |
| 1404 | + <xsl:when test="starts-with(ancestor::t:TEI//t:idno[@type='filename'],'o.')"> |
1371 | 1405 | <xsl:text> ostrakon</xsl:text>
|
1372 | 1406 | </xsl:when>
|
1373 | 1407 | <xsl:otherwise>
|
|
1394 | 1428 | </xsl:variable>
|
1395 | 1429 | <xsl:variable name="no-l">
|
1396 | 1430 | <xsl:choose>
|
1397 |
| - <xsl:when test="$apptype = 'siccorr'"><xsl:value-of select="substring-before(replace($scribeswitch, 'l. ', 'for which correct to '), '(corr)')" |
| 1431 | + <xsl:when test="$apptype = 'siccorr'"><xsl:value-of select="substring-before(replace($scribeswitch, 'l\. ', 'for which correct to '), '(corr)')" |
1398 | 1432 | /></xsl:when>
|
1399 |
| - <xsl:when test="$apptype = ('origreg', 'subst', 'appalt', 'apped')"><xsl:value-of select="replace($scribeswitch, 'l. ', 'for which read ')"/></xsl:when> |
1400 |
| - <xsl:when test="contains($scribeswitch, 'prev. ed.')"><xsl:value-of select="replace($scribeswitch, 'l. ', 'for which read ')"/></xsl:when> |
1401 |
| - <xsl:when test="$apptype = 'appbl'"><xsl:value-of select="replace($scribeswitch, 'l. ', 'normalises to ')"/></xsl:when> |
1402 |
| - <xsl:otherwise><xsl:value-of select="replace($scribeswitch, 'l. ', 'Scribe wrote ')" |
| 1433 | + <xsl:when test="$apptype = ('origreg', 'subst', 'appalt', 'apped')"><xsl:value-of select="replace($scribeswitch, 'l\. ', 'for which read ')"/></xsl:when> |
| 1434 | + <xsl:when test="contains($scribeswitch, 'prev. ed.')"><xsl:value-of select="replace($scribeswitch, 'l\. ', 'for which read ')"/></xsl:when> |
| 1435 | + <xsl:when test="$apptype = 'appbl'"><xsl:value-of select="replace($scribeswitch, 'l\. ', 'normalises to ')"/></xsl:when> |
| 1436 | + <xsl:otherwise><xsl:value-of select="replace($scribeswitch, 'l\. ', 'Scribe wrote ')" |
1403 | 1437 | /></xsl:otherwise>
|
1404 | 1438 | </xsl:choose>
|
1405 | 1439 | </xsl:variable>
|
|
0 commit comments