comparison software/eXist/webapp/mpdl/presentation/pageHtml.xsl @ 13:469d927b9ca7

diverse Fehlerbehebungen
author Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
date Tue, 19 Apr 2011 16:51:59 +0200
parents d6f528ad5d96
children e99964f390e4
comparison
equal deleted inserted replaced
12:fba5577e49d9 13:469d927b9ca7
9 xmlns:text="http://www.mpiwg-berlin.mpg.de/ns/mpdl/text" 9 xmlns:text="http://www.mpiwg-berlin.mpg.de/ns/mpdl/text"
10 xmlns:mpdl-util="http://www.mpiwg-berlin.mpg.de/ns/mpdl/util" 10 xmlns:mpdl-util="http://www.mpiwg-berlin.mpg.de/ns/mpdl/util"
11 xmlns:dc="http://purl.org/dc/elements/1.1/" 11 xmlns:dc="http://purl.org/dc/elements/1.1/"
12 xmlns:dcterms="http://purl.org/dc/terms" 12 xmlns:dcterms="http://purl.org/dc/terms"
13 xmlns:echo="http://www.mpiwg-berlin.mpg.de/ns/echo/1.0/" 13 xmlns:echo="http://www.mpiwg-berlin.mpg.de/ns/echo/1.0/"
14 xmlns:m="http://www.w3.org/1998/Math/MathML" 14 xmlns:math="http://www.w3.org/1998/Math/MathML"
15 xmlns:svg="http://www.w3.org/2000/svg" 15 xmlns:svg="http://www.w3.org/2000/svg"
16 xmlns:xhtml="http://www.w3.org/1999/xhtml"> 16 xmlns:xhtml="http://www.w3.org/1999/xhtml">
17 17
18 <xsl:import href="/db/mpdl/presentation/functions-mpdl.xsl" /> 18 <xsl:import href="/db/mpdl/presentation/functions-mpdl.xsl" />
19 <xsl:import href="/db/mpdl/presentation/functions-text.xsl" /> 19 <xsl:import href="/db/mpdl/presentation/functions-text.xsl" />
20 <xsl:import href="/db/mpdl/presentation/functions-util.xsl" /> 20 <xsl:import href="/db/mpdl/presentation/functions-util.xsl" />
748 <xsl:variable name="notes" select="/result/page/notes"/> 748 <xsl:variable name="notes" select="/result/page/notes"/>
749 <xsl:variable name="charNorm" select="/result/page/character-normalization"/> 749 <xsl:variable name="charNorm" select="/result/page/character-normalization"/>
750 750
751 <xsl:template match="text" mode="text"> 751 <xsl:template match="text" mode="text">
752 <xsl:apply-templates mode="text"/> 752 <xsl:apply-templates mode="text"/>
753 <!-- TEI Dictionary -->
754 <xsl:if test="not(empty(//entry))">
755 <xsl:for-each select="//entry">
756 <xsl:sort select="form/orth"/>
757 <xsl:variable name="position" select="position()"/>
758 <span class="entry">
759 <xsl:apply-templates mode="text" select="form"/>
760 <xsl:apply-templates mode="text" select="sense"/>
761 <xsl:if test="not(empty(figure))">
762 <span class="entryDiv">
763 <span class="bf"><xsl:value-of select="'Figures: '"/></span>
764 <span class="entryDiv">
765 <xsl:for-each select="figure">
766 <xsl:variable name="href" select="graphic/@url"/>
767 <xsl:variable name="head" select="head"/>
768 <xsl:variable name="figDesc" select="string(figDesc)"/>
769 <xsl:if test="$href != ''">
770 <div class="figure" style="margin-left:10px;">
771 <a href="{$href}"><img alt="Figure: {$figDesc}" src="{$href}" width="200" height="200"/></a>
772 <br/>
773 <xsl:value-of select="'[Figure]: '"/><xsl:value-of select="$head"/>
774 </div>
775 </xsl:if>
776 </xsl:for-each>
777 </span>
778 </span>
779 </xsl:if>
780 <xsl:if test="not(empty(xr))">
781 <span class="entryDiv">
782 <span class="bf"><xsl:value-of select="'References: '"/></span>
783 <span class="entryDiv">
784 <xsl:for-each select="xr/ref">
785 <li><xsl:apply-templates mode="text" select="."/></li>
786 </xsl:for-each>
787 </span>
788 </span>
789 </xsl:if>
790 </span>
791 </xsl:for-each>
792 </xsl:if>
753 <!-- Notes --> 793 <!-- Notes -->
754 <xsl:variable name="countEmptyPlaces" select="count($notes/note[empty(@place)])"/> 794 <xsl:variable name="countEmptyPlaces" select="count($notes/note[empty(@place)])"/>
755 <xsl:variable name="countBottomPlaces" select="count($notes/note[contains(@place, 'bottom')])"/> 795 <xsl:variable name="countBottomPlaces" select="count($notes/note[contains(@place, 'bottom')])"/>
756 <xsl:if test="($collectionName = 'archimedes' or $collectionName = 'tei') and count($notes/*) > 0"> 796 <xsl:if test="($collectionName = 'archimedes' or $collectionName = 'tei') and count($notes/*) > 0">
757 <div> 797 <div>
772 <xsl:when test="$place = '' or empty($place) or $place = 'bottom'"> 812 <xsl:when test="$place = '' or empty($place) or $place = 'bottom'">
773 <p> 813 <p>
774 <a> 814 <a>
775 <xsl:attribute name="name"><xsl:value-of select="concat('note-', $pageNumber, '-', $label)"/></xsl:attribute> 815 <xsl:attribute name="name"><xsl:value-of select="concat('note-', $pageNumber, '-', $label)"/></xsl:attribute>
776 <xsl:attribute name="href"><xsl:value-of select="concat(urlBase, '#', 'note-', $pageNumber, '-', $label, 'ref')"/></xsl:attribute> 816 <xsl:attribute name="href"><xsl:value-of select="concat(urlBase, '#', 'note-', $pageNumber, '-', $label, 'ref')"/></xsl:attribute>
777 <xsl:value-of select="concat('[↑ note-', $pageNumber, '-', $label, ']')"/> 817 <xsl:attribute name="class"><xsl:value-of select="'note'"/></xsl:attribute>
818 <xsl:value-of select="concat('note-', $pageNumber, '-', $label)"/>
778 </a> 819 </a>
779 <xsl:value-of select="': '"/> 820 <xsl:value-of select="': '"/>
780 <xsl:choose> 821 <xsl:choose>
781 <xsl:when test="$uid = '' or empty($uid)"> 822 <xsl:when test="$uid = '' or empty($uid)">
782 <span class="note"><xsl:apply-templates select="$noteWithoutNamespace/node()" mode="text"/></span> 823 <span class="note"><xsl:apply-templates select="$noteWithoutNamespace/node()" mode="text"/></span>
803 <xsl:variable name="noteWithoutNamespace" select="mpdl-util:copyWithoutNamespace(.)"/> 844 <xsl:variable name="noteWithoutNamespace" select="mpdl-util:copyWithoutNamespace(.)"/>
804 <p> 845 <p>
805 <a> 846 <a>
806 <xsl:attribute name="name"><xsl:value-of select="$label"/></xsl:attribute> 847 <xsl:attribute name="name"><xsl:value-of select="$label"/></xsl:attribute>
807 <xsl:attribute name="href"><xsl:value-of select="concat(urlBase, '#', $label, 'ref')"/></xsl:attribute> 848 <xsl:attribute name="href"><xsl:value-of select="concat(urlBase, '#', $label, 'ref')"/></xsl:attribute>
808 <xsl:value-of select="concat('[↑ ', $label, ']')"/> 849 <xsl:attribute name="class"><xsl:value-of select="'note'"/></xsl:attribute>
850 <xsl:value-of select="$label"/>
809 </a> 851 </a>
810 <xsl:value-of select="': '"/> 852 <xsl:value-of select="': '"/>
811 <xsl:choose> 853 <xsl:choose>
812 <xsl:when test="$uid = '' or empty($uid)"> 854 <xsl:when test="$uid = '' or empty($uid)">
813 <span class="note"><xsl:apply-templates select="$noteWithoutNamespace/node()" mode="text"/></span> 855 <span class="note"><xsl:apply-templates select="$noteWithoutNamespace/node()" mode="text"/></span>
827 <p class="bf center"><xsl:apply-templates mode="text"/></p> 869 <p class="bf center"><xsl:apply-templates mode="text"/></p>
828 </xsl:template> 870 </xsl:template>
829 871
830 <!-- TEI: segmentation --> 872 <!-- TEI: segmentation -->
831 <xsl:template match="seg" mode="text"> 873 <xsl:template match="seg" mode="text">
832 <span class="seg"> 874 <xsl:choose>
833 <xsl:apply-templates mode="text"/> 875 <xsl:when test="@rend = 'highlight'">
834 </span> 876 <span class="seg highlight"><xsl:apply-templates mode="text"/></span>
877 </xsl:when>
878 <xsl:when test="@rend = 'highlightPoint'">
879 <span class="seg highlightPoint"><xsl:apply-templates mode="text"/></span>
880 </xsl:when>
881 <xsl:otherwise>
882 <span class="seg"><xsl:apply-templates mode="text"/></span>
883 </xsl:otherwise>
884 </xsl:choose>
835 </xsl:template> 885 </xsl:template>
836 886
837 <!-- TEI: choice --> 887 <!-- TEI: choice -->
838 <xsl:template match="choice" mode="text"> 888 <xsl:template match="choice" mode="text">
839 <xsl:if test="not(empty(orig))"> 889 <xsl:if test="not(empty(orig))">
854 <xsl:template match="hi" mode="text"> 904 <xsl:template match="hi" mode="text">
855 <xsl:choose> 905 <xsl:choose>
856 <xsl:when test="@rend = 'initial'"> 906 <xsl:when test="@rend = 'initial'">
857 <span class="dc-unmodified"><xsl:apply-templates mode="text"/></span> 907 <span class="dc-unmodified"><xsl:apply-templates mode="text"/></span>
858 </xsl:when> 908 </xsl:when>
909 <xsl:when test="@rend = 'bold'">
910 <span class="bf"><xsl:apply-templates mode="text"/></span>
911 </xsl:when>
859 <xsl:otherwise> 912 <xsl:otherwise>
860 <span class="@rend"><xsl:apply-templates mode="text"/></span> 913 <span>
914 <xsl:attribute name="class"><xsl:value-of select="@rend"/></xsl:attribute>
915 <xsl:apply-templates mode="text"/>
916 </span>
861 </xsl:otherwise> 917 </xsl:otherwise>
862 </xsl:choose> 918 </xsl:choose>
863 </xsl:template> 919 </xsl:template>
864 920
865 <!-- TEI: name (of type: place, person, ...) --> 921 <!-- TEI: name (of type: place, person, ...) -->
873 </xsl:when> 929 </xsl:when>
874 <xsl:when test="@type = 'org'"> 930 <xsl:when test="@type = 'org'">
875 <span class="organization" title="Organization"><xsl:apply-templates mode="text"/></span> 931 <span class="organization" title="Organization"><xsl:apply-templates mode="text"/></span>
876 </xsl:when> 932 </xsl:when>
877 <xsl:otherwise> 933 <xsl:otherwise>
878 <span class="@type"><xsl:apply-templates mode="text"/></span> 934 <span>
935 <xsl:attribute name="class"><xsl:value-of select="@type"/></xsl:attribute>
936 <xsl:apply-templates mode="text"/>
937 </span>
879 </xsl:otherwise> 938 </xsl:otherwise>
880 </xsl:choose> 939 </xsl:choose>
881 </xsl:template> 940 </xsl:template>
882 941
883 <!-- TEI: place, person, ...) --> 942 <!-- TEI: place, person, ...) -->
959 <td><xsl:apply-templates mode="text"/></td> 1018 <td><xsl:apply-templates mode="text"/></td>
960 </xsl:otherwise> 1019 </xsl:otherwise>
961 </xsl:choose> 1020 </xsl:choose>
962 </xsl:template> 1021 </xsl:template>
963 1022
1023 <!-- TEI: dictionary -->
1024 <xsl:template match="entry" mode="text">
1025 <!-- empty: handled in text tag -->
1026 </xsl:template>
1027
1028 <xsl:template match="form" mode="text">
1029 <span class="form">
1030 <xsl:apply-templates mode="text"/>
1031 </span>
1032 </xsl:template>
1033
1034 <xsl:template match="orth" mode="text">
1035 <span class="orth">
1036 <xsl:apply-templates mode="text"/>
1037 </span>
1038 </xsl:template>
1039
1040 <xsl:template match="sense" mode="text">
1041 <span class="entryDiv"><xsl:apply-templates mode="text" select="def"/></span>
1042 <span class="entryDiv"><xsl:apply-templates mode="text" select="etym"/></span>
1043 </xsl:template>
1044
1045 <xsl:template match="def" mode="text">
1046 <span class="def">
1047 <span class="bf"><xsl:value-of select="'Definition: '"/></span>
1048 <xsl:apply-templates mode="text"/>
1049 </span>
1050 </xsl:template>
1051
1052 <xsl:template match="mentioned" mode="text">
1053 <span class="mentioned">
1054 <xsl:apply-templates mode="text"/>
1055 </span>
1056 </xsl:template>
1057
1058 <xsl:template match="etym" mode="text">
1059 <span class="etym">
1060 <span class="bf"><xsl:value-of select="'Etymology: '"/></span>
1061 <span class="entryDiv">
1062 <xsl:for-each select="cit">
1063 <li><xsl:value-of select="quote"/><xsl:value-of select="' ('"/><xsl:value-of select="def"/><xsl:value-of select="')'"/></li>
1064 </xsl:for-each>
1065 </span>
1066 </span>
1067 </xsl:template>
1068
1069 <xsl:template match="cit" mode="text">
1070 <span class="cit">
1071 <xsl:apply-templates mode="text"/>
1072 </span>
1073 </xsl:template>
1074
964 <!-- TEI: MathML --> 1075 <!-- TEI: MathML -->
965 <xsl:template match="m:*" mode="text"> 1076 <xsl:template match="math:*" mode="text">
966 <xsl:element name="{name()}" namespace=""> 1077 <xsl:element name="{name()}" namespace="">
967 <xsl:copy-of select="@*"/> 1078 <xsl:copy-of select="@*"/>
968 <xsl:apply-templates mode="text"/> 1079 <xsl:apply-templates mode="text"/>
969 </xsl:element> 1080 </xsl:element>
970 </xsl:template> 1081 </xsl:template>
1016 </div> 1127 </div>
1017 </xsl:template> 1128 </xsl:template>
1018 1129
1019 <xsl:template match="p" mode="text"> 1130 <xsl:template match="p" mode="text">
1020 <xsl:variable name="style" select="@style"/> 1131 <xsl:variable name="style" select="@style"/>
1021 <p> 1132 <xsl:choose>
1022 <xsl:if test="not(empty($style))"> 1133 <xsl:when test="not(empty($style))">
1023 <xsl:attribute name="class"><xsl:value-of select="$style"/></xsl:attribute> 1134 <div>
1024 </xsl:if> 1135 <xsl:attribute name="class"><xsl:value-of select="'p'"/></xsl:attribute>
1025 <xsl:apply-templates mode="text"/> 1136 <span>
1026 </p> 1137 <xsl:attribute name="class"><xsl:value-of select="$style"/></xsl:attribute>
1138 <xsl:apply-templates mode="text"/>
1139 </span>
1140 </div>
1141 </xsl:when>
1142 <xsl:otherwise>
1143 <div>
1144 <xsl:attribute name="class"><xsl:value-of select="'p'"/></xsl:attribute>
1145 <xsl:apply-templates mode="text"/>
1146 </div>
1147 </xsl:otherwise>
1148 </xsl:choose>
1027 </xsl:template> 1149 </xsl:template>
1028 1150
1029 <xsl:template match="lb" mode="text"> 1151 <xsl:template match="lb" mode="text">
1030 <xsl:variable name="withoutLBs"> 1152 <xsl:variable name="withoutLBs">
1031 <xsl:choose> 1153 <xsl:choose>
1053 <xsl:choose> 1175 <xsl:choose>
1054 <xsl:when test="$collectionName = 'archimedes'"> 1176 <xsl:when test="$collectionName = 'archimedes'">
1055 <a> 1177 <a>
1056 <xsl:attribute name="name"><xsl:value-of select="concat($href, 'ref')"/></xsl:attribute> 1178 <xsl:attribute name="name"><xsl:value-of select="concat($href, 'ref')"/></xsl:attribute>
1057 <xsl:attribute name="href"><xsl:value-of select="concat(urlBase, '#', $href)"/></xsl:attribute> 1179 <xsl:attribute name="href"><xsl:value-of select="concat(urlBase, '#', $href)"/></xsl:attribute>
1058 <xsl:attribute name="class"><xsl:value-of select="'super'"/></xsl:attribute> 1180 <xsl:attribute name="class"><xsl:value-of select="'noteRef super'"/></xsl:attribute>
1059 <xsl:value-of select="concat(' ↓ (', $href, ') ')"/> 1181 <xsl:value-of select="$href"/>
1060 </a> 1182 </a>
1061 </xsl:when> 1183 </xsl:when>
1062 <xsl:when test="$collectionName = 'echo' and not($hasLabel)"> 1184 <xsl:when test="$collectionName = 'echo' and not($hasLabel)">
1063 <p> 1185 <p>
1064 <xsl:value-of select="'[Note]: '"/> 1186 <xsl:value-of select="'[Note]: '"/>
1075 </xsl:when> 1197 </xsl:when>
1076 <xsl:otherwise> 1198 <xsl:otherwise>
1077 <a> 1199 <a>
1078 <xsl:attribute name="name"><xsl:value-of select="concat($href, 'ref')"/></xsl:attribute> 1200 <xsl:attribute name="name"><xsl:value-of select="concat($href, 'ref')"/></xsl:attribute>
1079 <xsl:attribute name="href"><xsl:value-of select="concat(urlBase, '#', $href)"/></xsl:attribute> 1201 <xsl:attribute name="href"><xsl:value-of select="concat(urlBase, '#', $href)"/></xsl:attribute>
1080 <xsl:attribute name="class"><xsl:value-of select="'super'"/></xsl:attribute> 1202 <xsl:attribute name="class"><xsl:value-of select="'noteRef super'"/></xsl:attribute>
1081 <xsl:value-of select="concat(' ↓ (', $href, ') ')"/> 1203 <xsl:value-of select="$href"/>
1082 </a> 1204 </a>
1083 </xsl:otherwise> 1205 </xsl:otherwise>
1084 </xsl:choose> 1206 </xsl:choose>
1085 </xsl:when> 1207 </xsl:when>
1086 <xsl:otherwise> 1208 <xsl:otherwise>
1088 </xsl:otherwise> 1210 </xsl:otherwise>
1089 </xsl:choose> 1211 </xsl:choose>
1090 </xsl:template> 1212 </xsl:template>
1091 1213
1092 <xsl:template match="emph" mode="text"> 1214 <xsl:template match="emph" mode="text">
1093 <xsl:variable name="class" select="@class"/>
1094 <xsl:variable name="style" select="@style"/> 1215 <xsl:variable name="style" select="@style"/>
1216 <xsl:variable name="styleWithoutSC" select="replace($style, 'sc ', '')"/>
1095 <xsl:variable name="text" select="string-join(., '')"/> 1217 <xsl:variable name="text" select="string-join(., '')"/>
1096 <xsl:variable name="length" select="string-length($text)"/> 1218 <xsl:variable name="length" select="string-length($text)"/>
1097 <xsl:variable name="firstChar" select="substring($text, 1, 1)"/> 1219 <xsl:variable name="firstChar" select="substring($text, 1, 1)"/>
1098 <xsl:variable name="first2Chars" select="substring($text, 1, 2)"/> 1220 <xsl:variable name="first2Chars" select="substring($text, 1, 2)"/>
1099 <xsl:variable name="restChars" select="substring($text, 2, $length)"/> 1221 <xsl:variable name="restChars" select="substring($text, 2, $length)"/>
1109 <xsl:otherwise><xsl:value-of select="$restChars"/></xsl:otherwise> 1231 <xsl:otherwise><xsl:value-of select="$restChars"/></xsl:otherwise>
1110 </xsl:choose> 1232 </xsl:choose>
1111 </xsl:otherwise> 1233 </xsl:otherwise>
1112 </xsl:choose> 1234 </xsl:choose>
1113 </xsl:variable> 1235 </xsl:variable>
1114 <xsl:if test="$collectionName = 'echo' and not(contains($class, 'sc'))"><span class="{$class} {$style}"><xsl:apply-templates mode="text"/></span></xsl:if> 1236 <xsl:choose>
1115 <xsl:if test="$collectionName = 'echo' and contains($class, 'sc') and $first2CharsAreUppercase"><span class="dc {$style}"><xsl:value-of select="$firstChar"/></span><span class="{$class} {$style}"><xsl:sequence select="$rest"/></span></xsl:if> 1237 <xsl:when test="$collectionName = 'echo' and not(contains($style, 'sc'))">
1116 <xsl:if test="$collectionName = 'echo' and contains($class, 'sc') and not($first2CharsAreUppercase)"><span class="{$class} {$style}"><xsl:apply-templates mode="text"/></span></xsl:if> 1238 <span class="{$style}"><xsl:apply-templates mode="text"/></span>
1117 <xsl:if test="$collectionName = 'archimedes'"><xsl:apply-templates mode="text"/></xsl:if> 1239 </xsl:when>
1240 <xsl:when test="$collectionName = 'echo' and $style = 'sc' and $first2CharsAreUppercase">
1241 <span class="dc"><xsl:value-of select="$firstChar"/></span><span class="sc"><xsl:sequence select="$rest"/></span>
1242 </xsl:when>
1243 <xsl:when test="$collectionName = 'echo' and contains($style, 'sc') and $first2CharsAreUppercase">
1244 <span class="dc"><span class="{$styleWithoutSC}"><xsl:value-of select="$firstChar"/></span></span><span class="sc"><span class="{$styleWithoutSC}"><xsl:sequence select="$rest"/></span></span>
1245 </xsl:when>
1246 <xsl:when test="$collectionName = 'echo' and $style = 'sc' and not($first2CharsAreUppercase)">
1247 <xsl:apply-templates mode="text"/>
1248 </xsl:when>
1249 <xsl:when test="$collectionName = 'echo' and contains($style, 'sc') and not($first2CharsAreUppercase)">
1250 <span class="sc"><span class="{$styleWithoutSC}"><xsl:apply-templates mode="text"/></span></span>
1251 </xsl:when>
1252 <xsl:when test="$collectionName = 'archimedes'">
1253 <xsl:apply-templates mode="text"/>
1254 </xsl:when>
1255 <xsl:otherwise><xsl:apply-templates mode="text"/></xsl:otherwise>
1256 </xsl:choose>
1118 </xsl:template> 1257 </xsl:template>
1119 1258
1120 <xsl:template match="foreign" mode="text"> 1259 <xsl:template match="foreign" mode="text">
1121 <xsl:variable name="lang" select="@lang"/> 1260 <xsl:variable name="lang" select="@lang"/>
1122 <xsl:variable name="xmllang" select="@xml:lang"/> 1261 <xsl:variable name="xmllang" select="@xml:lang"/>
1197 <xsl:when test="$collectionName = 'archimedes'"><xsl:value-of select="$firstFigurePosition + count($figure/preceding::figure)"/></xsl:when> 1336 <xsl:when test="$collectionName = 'archimedes'"><xsl:value-of select="$firstFigurePosition + count($figure/preceding::figure)"/></xsl:when>
1198 <xsl:when test="$collectionName = 'echo'"><xsl:value-of select="$firstFigurePosition + count(./preceding::figure[empty(@xlink:label)]) + count(./preceding::anchor[@type = 'figure'])"/></xsl:when> 1337 <xsl:when test="$collectionName = 'echo'"><xsl:value-of select="$firstFigurePosition + count(./preceding::figure[empty(@xlink:label)]) + count(./preceding::anchor[@type = 'figure'])"/></xsl:when>
1199 <xsl:otherwise><xsl:value-of select="$firstFigurePosition + count(./preceding::echo:figure[empty(@xlink:label)]) + count(./preceding::echo:anchor[@type = 'figure'])"/></xsl:otherwise> 1338 <xsl:otherwise><xsl:value-of select="$firstFigurePosition + count(./preceding::echo:figure[empty(@xlink:label)]) + count(./preceding::echo:anchor[@type = 'figure'])"/></xsl:otherwise>
1200 </xsl:choose> 1339 </xsl:choose>
1201 </xsl:variable> 1340 </xsl:variable>
1202 <xsl:variable name="figureCaption"> 1341 <xsl:variable name="figureCaption"><xsl:apply-templates mode="text" select="$figure/echo:caption"/></xsl:variable>
1203 <xsl:choose> 1342 <xsl:variable name="figureDescription">
1204 <xsl:when test="not(empty($figure/echo:caption))"><xsl:value-of select="string-join($figure/echo:caption/text(), ' ')"/></xsl:when> 1343 <xsl:for-each select="$figure/echo:description">
1205 <xsl:otherwise><xsl:value-of select="''"/></xsl:otherwise> 1344 <xsl:apply-templates mode="text" select="."/><br/>
1206 </xsl:choose> 1345 </xsl:for-each>
1207 </xsl:variable> 1346 </xsl:variable>
1208 <xsl:variable name="figureDescription"> 1347 <xsl:variable name="figureVariables"><xsl:apply-templates mode="text" select="$figure/echo:variables"/></xsl:variable>
1209 <xsl:choose>
1210 <xsl:when test="not(empty($figure/echo:description))"><xsl:value-of select="string-join($figure/echo:description/text(), ' ')"/></xsl:when>
1211 <xsl:otherwise><xsl:value-of select="''"/></xsl:otherwise>
1212 </xsl:choose>
1213 </xsl:variable>
1214 <xsl:variable name="figureVariables">
1215 <xsl:choose>
1216 <xsl:when test="not(empty($figure/echo:variables))"><xsl:value-of select="string-join($figure/echo:variables/text(), ' ')"/></xsl:when>
1217 <xsl:otherwise><xsl:value-of select="''"/></xsl:otherwise>
1218 </xsl:choose>
1219 </xsl:variable>
1220 <xsl:sequence select="mpdl:showFigure($digilibAvailable, $figureFileName, $figureNumber, $figureCaption, $figureDescription, $figureVariables, 'float right')"/> 1348 <xsl:sequence select="mpdl:showFigure($digilibAvailable, $figureFileName, $figureNumber, $figureCaption, $figureDescription, $figureVariables, 'float right')"/>
1221 </xsl:when> 1349 </xsl:when>
1222 <xsl:when test="$type = 'handwritten'"> 1350 <xsl:when test="$type = 'handwritten'">
1223 <xsl:variable name="hw" select="$handwritten/echo:handwritten[@xlink:label = $href]"/> 1351 <xsl:variable name="hw" select="$handwritten/echo:handwritten[@xlink:label = $href]"/>
1224 <xsl:variable name="hwFileName" select="$hw/@file"/> 1352 <xsl:variable name="hwFileName" select="$hw/@file"/>
1231 </xsl:when> 1359 </xsl:when>
1232 <xsl:when test="$type = 'note'"> 1360 <xsl:when test="$type = 'note'">
1233 <a> 1361 <a>
1234 <xsl:attribute name="name"><xsl:value-of select="concat($href, 'ref')"/></xsl:attribute> 1362 <xsl:attribute name="name"><xsl:value-of select="concat($href, 'ref')"/></xsl:attribute>
1235 <xsl:attribute name="href"><xsl:value-of select="concat(urlBase, '#', $href)"/></xsl:attribute> 1363 <xsl:attribute name="href"><xsl:value-of select="concat(urlBase, '#', $href)"/></xsl:attribute>
1236 <xsl:attribute name="class"><xsl:value-of select="'super'"/></xsl:attribute> 1364 <xsl:attribute name="class"><xsl:value-of select="'noteRef super'"/></xsl:attribute>
1237 <xsl:value-of select="concat('↓ (', $href, ')')"/> 1365 <xsl:value-of select="$href"/>
1238 </a> 1366 </a>
1239 </xsl:when> 1367 </xsl:when>
1240 <xsl:otherwise><a><xsl:attribute name="href"><xsl:value-of select="$href"/></xsl:attribute><xsl:apply-templates mode="text"/></a></xsl:otherwise> 1368 <xsl:otherwise><a><xsl:attribute name="href"><xsl:value-of select="$href"/></xsl:attribute><xsl:apply-templates mode="text"/></a></xsl:otherwise>
1241 </xsl:choose> 1369 </xsl:choose>
1242 </xsl:template> 1370 </xsl:template>
1277 <xsl:if test="empty(w)"> 1405 <xsl:if test="empty(w)">
1278 <xsl:value-of select="concat('interface/lt/wordInfo.xql?type=place', '&amp;language=', $language, '&amp;word=', $wordStr, '&amp;output=html', '&amp;placeHref=', encode-for-uri($href))"/> 1406 <xsl:value-of select="concat('interface/lt/wordInfo.xql?type=place', '&amp;language=', $language, '&amp;word=', $wordStr, '&amp;output=html', '&amp;placeHref=', encode-for-uri($href))"/>
1279 </xsl:if> 1407 </xsl:if>
1280 </xsl:variable> 1408 </xsl:variable>
1281 <span class="place"> 1409 <span class="place">
1282 <a class="textPollux"><xsl:attribute name="href"><xsl:value-of select="$lexHref"/></xsl:attribute><xsl:value-of select="$wordStr"/></a> 1410 <a class="place"><xsl:attribute name="href"><xsl:value-of select="$lexHref"/></xsl:attribute><xsl:sequence select="$wordStr"/></a>
1283 </span> 1411 </span>
1284 </xsl:when> 1412 </xsl:when>
1285 <xsl:when test="$mode = 'gis'"> 1413 <xsl:when test="$mode = 'gis'">
1286 <a><xsl:attribute name="href"><xsl:value-of select="$href"/></xsl:attribute><xsl:apply-templates mode="text"/></a> 1414 <a><xsl:attribute name="href"><xsl:value-of select="$href"/></xsl:attribute><xsl:apply-templates mode="text"/></a>
1287 </xsl:when> 1415 </xsl:when>
1327 </xsl:template> 1455 </xsl:template>
1328 1456
1329 <xsl:template match="figure" mode="text"> 1457 <xsl:template match="figure" mode="text">
1330 <xsl:variable name="hasLabel" select="string(@xlink:label) != ''"/> 1458 <xsl:variable name="hasLabel" select="string(@xlink:label) != ''"/>
1331 <xsl:choose> 1459 <xsl:choose>
1332 <xsl:when test="not($hasLabel)"> 1460 <xsl:when test="not($hasLabel) and $collectionName != 'tei'">
1333 <xsl:variable name="figureFileName"> 1461 <xsl:variable name="figureFileName">
1334 <xsl:choose> 1462 <xsl:choose>
1335 <xsl:when test="$collectionName = 'archimedes'"><xsl:value-of select="replace(./@xlink:href, '/', '.')"/></xsl:when> 1463 <xsl:when test="$collectionName = 'archimedes'"><xsl:value-of select="replace(./@xlink:href, '/', '.')"/></xsl:when>
1336 <xsl:when test="$collectionName = 'echo'"><xsl:value-of select="./image/@file"/></xsl:when> 1464 <xsl:when test="$collectionName = 'echo'"><xsl:value-of select="./image/@file"/></xsl:when>
1337 <xsl:when test="$collectionName = 'tei'"><xsl:value-of select="@facs"/></xsl:when>
1338 <xsl:otherwise><xsl:value-of select="./image/@file"/></xsl:otherwise> 1465 <xsl:otherwise><xsl:value-of select="./image/@file"/></xsl:otherwise>
1339 </xsl:choose> 1466 </xsl:choose>
1340 </xsl:variable> 1467 </xsl:variable>
1341 <xsl:variable name="figureNumber"> 1468 <xsl:variable name="figureNumber">
1342 <xsl:choose> 1469 <xsl:choose>
1343 <xsl:when test="$collectionName = 'archimedes'"><xsl:value-of select="$firstFigurePosition + count(./preceding::figure)"/></xsl:when> 1470 <xsl:when test="$collectionName = 'archimedes'"><xsl:value-of select="$firstFigurePosition + count(./preceding::figure)"/></xsl:when>
1344 <xsl:when test="$collectionName = 'echo'"><xsl:value-of select="$firstFigurePosition + count(./preceding::figure[empty(@xlink:label)]) + count(./preceding::anchor[@type = 'figure'])"/></xsl:when> 1471 <xsl:when test="$collectionName = 'echo'"><xsl:value-of select="$firstFigurePosition + count(./preceding::figure[empty(@xlink:label)]) + count(./preceding::anchor[@type = 'figure'])"/></xsl:when>
1345 <xsl:when test="$collectionName = 'tei'"><xsl:value-of select="$firstFigurePosition + count(./preceding::figure)"/></xsl:when>
1346 <xsl:otherwise><xsl:value-of select="$firstFigurePosition + count(./preceding::figure[empty(@xlink:label)]) + count(./preceding::anchor[@type = 'figure'])"/></xsl:otherwise> 1472 <xsl:otherwise><xsl:value-of select="$firstFigurePosition + count(./preceding::figure[empty(@xlink:label)]) + count(./preceding::anchor[@type = 'figure'])"/></xsl:otherwise>
1347 </xsl:choose> 1473 </xsl:choose>
1348 </xsl:variable> 1474 </xsl:variable>
1349 <xsl:variable name="figureCaption" select="./caption/text()"/> 1475 <xsl:variable name="figureCaption"><xsl:apply-templates mode="text" select="caption"/></xsl:variable>
1350 <xsl:variable name="figureDescription" select="./description/text()"/> 1476 <xsl:variable name="figureDescription">
1351 <xsl:variable name="figureVariables" select="./variables/text()"/> 1477 <xsl:for-each select="description">
1478 <xsl:apply-templates mode="text" select="."/><br/>
1479 </xsl:for-each>
1480 </xsl:variable>
1481 <xsl:variable name="figureVariables"><xsl:apply-templates mode="text" select="variables"/></xsl:variable>
1352 <xsl:sequence select="mpdl:showFigure($digilibAvailable, $figureFileName, $figureNumber, $figureCaption, $figureDescription, $figureVariables, 'float none')"/> 1482 <xsl:sequence select="mpdl:showFigure($digilibAvailable, $figureFileName, $figureNumber, $figureCaption, $figureDescription, $figureVariables, 'float none')"/>
1353 </xsl:when> 1483 </xsl:when>
1484 <xsl:when test="not($hasLabel) and $collectionName = 'tei'">
1485 <xsl:variable name="figureNumber" select="$firstFigurePosition + count(./preceding::figure)"/>
1486 <xsl:choose>
1487 <xsl:when test="@facs != ''">
1488 <xsl:sequence select="mpdl:showFigure($digilibAvailable, @facs, $figureNumber, '', '', '', 'float none')"/>
1489 </xsl:when>
1490 <xsl:otherwise>
1491 <xsl:variable name="href" select="graphic/@url"/>
1492 <xsl:variable name="head" select="head"/>
1493 <xsl:variable name="figDesc" select="string(figDesc)"/>
1494 <div class="figure" style="margin-left:10px;">
1495 <a href="{$href}"><img alt="Figure: {$figDesc}" src="{$href}" width="200" height="200"/></a>
1496 <br/>
1497 <xsl:value-of select="concat('[Figure ', $figureNumber, ']: ')"/><xsl:value-of select="$head"/>
1498 </div>
1499 </xsl:otherwise>
1500 </xsl:choose>
1501 </xsl:when>
1354 <xsl:otherwise></xsl:otherwise> 1502 <xsl:otherwise></xsl:otherwise>
1355 </xsl:choose> 1503 </xsl:choose>
1504 </xsl:template>
1505
1506 <xsl:template match="caption" mode="text">
1507 <span class="figureCaption"><xsl:apply-templates mode="text"/></span>
1508 </xsl:template>
1509
1510 <xsl:template match="description" mode="text">
1511 <span class="figureDescription"><xsl:apply-templates mode="text"/></span>
1356 </xsl:template> 1512 </xsl:template>
1357 1513
1358 <xsl:template match="handwritten" mode="text"> 1514 <xsl:template match="handwritten" mode="text">
1359 <xsl:variable name="hasLabel" select="string(@xlink:label) != ''"/> 1515 <xsl:variable name="hasLabel" select="string(@xlink:label) != ''"/>
1360 <xsl:choose> 1516 <xsl:choose>
1370 1526
1371 <!-- textPollux links --> 1527 <!-- textPollux links -->
1372 <xsl:template match="w" mode="text"> 1528 <xsl:template match="w" mode="text">
1373 <xsl:variable name="wordLanguage" select="@lang"/> 1529 <xsl:variable name="wordLanguage" select="@lang"/>
1374 <xsl:variable name="form" select="@form"/> 1530 <xsl:variable name="form" select="@form"/>
1375 <a class="textPollux"> 1531 <xsl:choose>
1376 <xsl:attribute name="href"><xsl:value-of select="concat('interface/lt/wordInfo.xql?language=', $wordLanguage, '&amp;word=', $form, '&amp;output=html')"/></xsl:attribute> 1532 <xsl:when test="not(empty(anchor))">
1377 <xsl:apply-templates mode="text"/> 1533 <xsl:for-each select="node()">
1378 </a> 1534 <xsl:choose>
1535 <xsl:when test=". instance of text()">
1536 <a class="textPollux">
1537 <xsl:attribute name="href"><xsl:value-of select="concat('interface/lt/wordInfo.xql?language=', $wordLanguage, '&amp;word=', $form, '&amp;output=html')"/></xsl:attribute>
1538 <xsl:apply-templates mode="text" select="."/>
1539 </a>
1540 </xsl:when>
1541 <xsl:otherwise>
1542 <xsl:apply-templates mode="text" select="."/>
1543 </xsl:otherwise>
1544 </xsl:choose>
1545 </xsl:for-each>
1546 </xsl:when>
1547 <xsl:otherwise>
1548 <a class="textPollux">
1549 <xsl:attribute name="href"><xsl:value-of select="concat('interface/lt/wordInfo.xql?language=', $wordLanguage, '&amp;word=', $form, '&amp;output=html')"/></xsl:attribute>
1550 <xsl:apply-templates mode="text"/>
1551 </a>
1552 </xsl:otherwise>
1553 </xsl:choose>
1379 </xsl:template> 1554 </xsl:template>
1380 1555
1381 <xsl:template match="s" mode="text"> 1556 <xsl:template match="s" mode="text">
1557 <xsl:variable name="style" select="@style"/>
1382 <xsl:variable name="actualSN"> 1558 <xsl:variable name="actualSN">
1383 <xsl:choose> 1559 <xsl:choose>
1384 <xsl:when test=". = $firstSentence and ($topPB >> .)">0</xsl:when> 1560 <xsl:when test=". = $firstSentence and ($topPB >> .)">0</xsl:when>
1385 <xsl:otherwise><xsl:value-of select="count(preceding::s[. >> $topPB]) + 1"/></xsl:otherwise> 1561 <xsl:otherwise><xsl:value-of select="count(preceding::s[. >> $topPB]) + 1"/></xsl:otherwise>
1386 </xsl:choose> 1562 </xsl:choose>
1389 <xsl:choose> 1565 <xsl:choose>
1390 <!-- Show the sentence in color light grey if it is given as sn --> 1566 <!-- Show the sentence in color light grey if it is given as sn -->
1391 <xsl:when test="$sn >= 0 and $sn = $actualSN"> 1567 <xsl:when test="$sn >= 0 and $sn = $actualSN">
1392 <span class="s highlight"> 1568 <span class="s highlight">
1393 <xsl:if test="not(empty(@xmlNodeId))"><xsl:attribute name="xmlNodeId"><xsl:value-of select="@xmlNodeId"/></xsl:attribute></xsl:if> 1569 <xsl:if test="not(empty(@xmlNodeId))"><xsl:attribute name="xmlNodeId"><xsl:value-of select="@xmlNodeId"/></xsl:attribute></xsl:if>
1394 <xsl:apply-templates mode="text"/> 1570 <xsl:choose>
1571 <xsl:when test="empty(@style)">
1572 <xsl:apply-templates mode="text"/>
1573 </xsl:when>
1574 <xsl:otherwise>
1575 <span class="{$style}"><xsl:apply-templates mode="text"/></span>
1576 </xsl:otherwise>
1577 </xsl:choose>
1395 </span> 1578 </span>
1396 </xsl:when> 1579 </xsl:when>
1397 <xsl:otherwise> 1580 <xsl:otherwise>
1398 <span class="s"> 1581 <span class="s">
1399 <xsl:if test="not(empty(@xmlNodeId))"><xsl:attribute name="xmlNodeId"><xsl:value-of select="@xmlNodeId"/></xsl:attribute></xsl:if> 1582 <xsl:if test="not(empty(@xmlNodeId))"><xsl:attribute name="xmlNodeId"><xsl:value-of select="@xmlNodeId"/></xsl:attribute></xsl:if>
1400 <xsl:apply-templates mode="text"/> 1583 <xsl:choose>
1584 <xsl:when test="empty(@style)">
1585 <xsl:apply-templates mode="text"/>
1586 </xsl:when>
1587 <xsl:otherwise>
1588 <span class="{$style}"><xsl:apply-templates mode="text"/></span>
1589 </xsl:otherwise>
1590 </xsl:choose>
1401 </span> 1591 </span>
1402 </xsl:otherwise> 1592 </xsl:otherwise>
1403 </xsl:choose> 1593 </xsl:choose>
1404 </xsl:template> 1594 </xsl:template>
1405 1595