comparison software/eXist/webapp/mpdl/presentation/pageHtml.xsl @ 17:7e883ce72fec

diverse Fehlerbehebungen
author Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
date Tue, 27 Sep 2011 16:41:15 +0200
parents e99964f390e4
children
comparison
equal deleted inserted replaced
16:257f67be5c00 17:7e883ce72fec
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:math="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="/mpdl/presentation/functions-mpdl.xsl" />
19 <xsl:import href="/db/mpdl/presentation/functions-text.xsl" /> 19 <xsl:import href="/mpdl/presentation/functions-text.xsl" />
20 <xsl:import href="/db/mpdl/presentation/functions-util.xsl" /> 20 <xsl:import href="/mpdl/presentation/functions-util.xsl" />
21
22 <xsl:strip-space elements="*"/>
23 21
24 <xsl:output method="xhtml" encoding="utf-8"/> 22 <xsl:output method="xhtml" encoding="utf-8"/>
25 23
24 <xsl:variable name="documentUri" select="/result/document-description/uri"/>
25 <xsl:variable name="documentName" select="/result/document-description/document-name"/>
26 <xsl:variable name="errorMessage" select="string(/result/query/result/error)"/> 26 <xsl:variable name="errorMessage" select="string(/result/query/result/error)"/>
27 <xsl:variable name="mode" select="/result/page/mode"/> 27 <xsl:variable name="mode" select="/result/page/mode"/>
28 <xsl:variable name="queryType" select="/result/query/type"/> 28 <xsl:variable name="queryType" select="/result/query/type"/>
29 <xsl:variable name="query" select="text:trim(string(/result/query/expression))"/> 29 <xsl:variable name="query" select="text:trim(string(/result/query/expression))"/>
30 <xsl:variable name="queryResultPages" select="number(/result/query/result/pages)"/> 30 <xsl:variable name="queryResultPages" select="number(/result/query/result/pages)"/>
70 <xsl:variable name="author" select="string-join(/result/document-description/authors/author, ', ')"/> 70 <xsl:variable name="author" select="string-join(/result/document-description/authors/author, ', ')"/>
71 <xsl:variable name="title" select="string-join(/result/document-description/titles/title, ', ')"/> 71 <xsl:variable name="title" select="string-join(/result/document-description/titles/title, ', ')"/>
72 <xsl:variable name="place" select="string-join(/result/document-description/places/place, ', ')"/> 72 <xsl:variable name="place" select="string-join(/result/document-description/places/place, ', ')"/>
73 <xsl:variable name="date" select="/result/document-description/date"/> 73 <xsl:variable name="date" select="/result/document-description/date"/>
74 <xsl:variable name="bookTitle"> 74 <xsl:variable name="bookTitle">
75 <xsl:value-of select="$author"/>. 75 <xsl:if test="$author != ''"><xsl:value-of select="$author"/>.</xsl:if>
76 <xsl:value-of select="$title"/>. 76 <xsl:if test="$title != ''"><xsl:value-of select="$title"/>.</xsl:if>
77 <xsl:value-of select="$place"/><xsl:if test="$place != ''">, </xsl:if> 77 <xsl:if test="$place != ''"><xsl:value-of select="$place"/>, </xsl:if>
78 <xsl:value-of select="$date"/>. 78 <xsl:if test="$date != ''"><xsl:value-of select="$date"/>.</xsl:if>
79 </xsl:variable> 79 </xsl:variable>
80 <html> 80 <html>
81 <head> 81 <head>
82 <title><xsl:value-of select="$bookTitle"/></title> 82 <title><xsl:value-of select="$bookTitle"/></title>
83 <link rel="stylesheet" type="text/css" href="presentation/pageHtml.css"/> 83 <link rel="stylesheet" type="text/css" href="presentation/pageHtml.css"/>
84 </head> 84 </head>
85 <body> 85 <body>
86 <text style="font-weight:bold;font-size:20px"><xsl:value-of select="$bookTitle"/></text> 86 <text style="font-weight:bold;font-size:20px"><xsl:value-of select="$bookTitle"/><xsl:if test="$bookTitle = ''"><xsl:value-of select="$documentUri"/></xsl:if></text>
87 <p/> 87 <p/>
88 <xsl:for-each select="page"> 88 <xsl:for-each select="page">
89 <xsl:variable name="documentUri" select="/result/document-description/uri"/>
90 <xsl:variable name="documentName" select="/result/document-description/document-name"/>
91 <xsl:variable name="countPages" select="/result/document-description/count-pages"/> 89 <xsl:variable name="countPages" select="/result/document-description/count-pages"/>
92 <xsl:variable name="pageHeader" select="header"/> 90 <xsl:variable name="pageHeader" select="header"/>
93 <xsl:variable name="pageNumber" select="number(number)"/> 91 <xsl:variable name="pageNumber" select="number(number)"/>
94 <xsl:variable name="pageNumberOrig" select="number-orig"/> 92 <xsl:variable name="pageNumberOrig" select="number-orig"/>
95 <xsl:variable name="documentValue" select="concat('document=', $documentUri)"/> 93 <xsl:variable name="documentValue" select="concat('document=', $documentUri)"/>
239 <td align="left"><b><xsl:value-of select="$pageNumberOrig"/></b></td> 237 <td align="left"><b><xsl:value-of select="$pageNumberOrig"/></b></td>
240 <td align="center"><b><xsl:value-of select="$pageHeader"/></b></td> 238 <td align="center"><b><xsl:value-of select="$pageHeader"/></b></td>
241 </tr> 239 </tr>
242 </table> 240 </table>
243 </xsl:if> 241 </xsl:if>
244 <table> 242 <table style="margin-left:80px">
245 <colgroup> 243 <colgroup>
246 <col width="90%"/> 244 <col width="90%"/>
247 <col width="10%"/> 245 <col width="10%"/>
248 </colgroup> 246 </colgroup>
249 <tr> 247 <tr>
250 <td> 248 <td>
251 <xsl:variable name="contentStr" select="normalize-space(string(.))"/> 249 <xsl:variable name="contentStr" select="normalize-space(string(.))"/>
252 <xsl:variable name="figures" select=".//figure|.//handwritten"/> 250 <xsl:variable name="figures" select=".//figure|.//handwritten|.//anchor[@type='figure']"/>
253 <xsl:if test="$contentStr = '' and empty($figures)"> 251 <xsl:if test="$contentStr = '' and empty($figures)">
254 <div class="emptyPage"><xsl:value-of select="'[Empty page]'"/></div> 252 <div class="emptyPage"><xsl:value-of select="'[Empty page]'"/></div>
255 </xsl:if> 253 </xsl:if>
256 <xsl:apply-templates mode="text"/> 254 <xsl:variable name="firstContentNodeName" select="./*[1]/name()"/>
255 <xsl:choose>
256 <xsl:when test="$firstContentNodeName = 'html'"><xsl:apply-templates select=".//body" mode="html"/></xsl:when>
257 <xsl:otherwise><xsl:apply-templates mode="text"/></xsl:otherwise>
258 </xsl:choose>
257 </td> 259 </td>
258 <td align="middle" valign="top"><p><a href="?{$documentValue}&amp;mode={$mode}&amp;pn={$pageNumber}&amp;sn={$sn}&amp;export=pdf&amp;options={$options}"><img src="images/download.png" width="24" height="24" border="0" alt="Download"/></a><br/>Download PDF</p></td> 260 <td align="middle" valign="top"><p><a href="?{$documentValue}&amp;mode={$mode}&amp;pn={$pageNumber}&amp;sn={$sn}&amp;export=pdf&amp;options={$options}"><img src="images/download.png" width="24" height="24" border="0" alt="Download"/></a><br/>Download PDF</p></td>
259 </tr> 261 </tr>
260 </table> 262 </table>
261 </td> 263 </td>
576 <xsl:variable name="dictionaryLink"> 578 <xsl:variable name="dictionaryLink">
577 <xsl:choose> 579 <xsl:choose>
578 <xsl:when test="$language = 'zh'"> 580 <xsl:when test="$language = 'zh'">
579 <xsl:variable name="termBig5Encoded" select="/result/query/result/big5-hits/entry-big5-encoded/term[$pos]"/> 581 <xsl:variable name="termBig5Encoded" select="/result/query/result/big5-hits/entry-big5-encoded/term[$pos]"/>
580 <a href="http://humanum.arts.cuhk.edu.hk/cgi-bin/agrep-lindict?query={$termBig5Encoded}&amp;category=wholerecord">Lin Yutang</a> 582 <a href="http://humanum.arts.cuhk.edu.hk/cgi-bin/agrep-lindict?query={$termBig5Encoded}&amp;category=wholerecord">Lin Yutang</a>
581 <!-- TODO: replace Java based function by XSL-function like the following, but that does not work yet cause termHexBin is not the same than by Java) also in query.xsl and functions-text.xsl -->
582 <xsl:variable name="termHexBin"><xsl:value-of select="saxon:string-to-hexBinary($term, 'utf8')"/></xsl:variable>
583 <xsl:variable name="termHexBinStr" select="string($termHexBin)"/>
584 <xsl:variable name="termBig5EncodedNew">
585 <xsl:for-each select="string-to-codepoints($termHexBinStr)">
586 <xsl:variable name="pos" select="position()"/>
587 <xsl:variable name="posIDiv" select="$pos idiv 2"/>
588 <xsl:variable name="posPlus1IDiv" select="($pos + 1) idiv 2"/>
589 <xsl:if test="$posIDiv != $posPlus1IDiv">
590 <xsl:variable name="charStr" select="substring($termHexBinStr, $pos, 2)"/>
591 <xsl:value-of select="encode-for-uri(concat('%', $charStr))"/>
592 </xsl:if>
593 </xsl:for-each>
594 </xsl:variable>
595 </xsl:when> 583 </xsl:when>
596 <xsl:otherwise><a href="http://archimedes.mpiwg-berlin.mpg.de/cgi-bin/toc/dict?step=table;word={$term};lang={$language};pro=echo">Echo</a></xsl:otherwise> 584 <xsl:otherwise><a href="http://archimedes.mpiwg-berlin.mpg.de/cgi-bin/toc/dict?step=table;word={$term};lang={$language};pro=echo">Echo</a></xsl:otherwise>
597 </xsl:choose> 585 </xsl:choose>
598 </xsl:variable> 586 </xsl:variable>
599 <xsl:variable name="polluxLink"> 587 <xsl:variable name="polluxLink">
658 <br/> 646 <br/>
659 </xsl:for-each> 647 </xsl:for-each>
660 </body></html> 648 </body></html>
661 </xsl:template> 649 </xsl:template>
662 650
663 <xsl:template match="attribute()|element()|text()|comment()|processing-instruction()" mode="xml"> 651 <!-- html mode: transform html texts -->
652 <xsl:template match="@*|node()" mode="html">
664 <xsl:copy> 653 <xsl:copy>
665 <xsl:apply-templates select="attribute()|element()|text()|comment()|processing-instruction()"/> 654 <xsl:apply-templates select="@*|node()" mode="html"/>
666 </xsl:copy> 655 </xsl:copy>
667 </xsl:template> 656 </xsl:template>
668 657
669 <xsl:template match="element()|comment()|processing-instruction()" mode="xml"> 658 <xsl:template match="s" mode="html">
659 <xsl:apply-templates select="." mode="text"/>
660 </xsl:template>
661
662 <xsl:template match="w" mode="html">
663 <xsl:apply-templates select="." mode="text"/>
664 </xsl:template>
665
666 <!-- xml mode: transform to browser like xml display -->
667 <xsl:template match="element()" mode="xml">
670 <xsl:variable name="elementName" select="name()"/> 668 <xsl:variable name="elementName" select="name()"/>
671 <xsl:variable name="countPrecedingElemsStr" select="concat('count(preceding::', $elementName, '[. >> $p1]) + 1')"/> 669 <xsl:variable name="countPrecedingElemsStr" select="concat('count(preceding::', $elementName, '[. >> $p1]) + 1')"/>
672 <xsl:variable name="elementPresentation"> 670 <xsl:variable name="elementPresentation">
673 <xsl:choose> 671 <xsl:choose>
674 <xsl:when test="element() = node() or text() != '' or self::comment() or self::processing-instruction()"> 672 <xsl:when test="element() = node() or text() != ''">
675 <xsl:value-of select="'&lt;'"/> 673 <xsl:value-of select="'&lt;'"/>
676 <span class="xml elementName"><xsl:value-of select="$elementName"/></span> 674 <span class="xml elementName"><xsl:value-of select="$elementName"/></span>
677 <xsl:apply-templates select="attribute()" mode="xml"/> 675 <xsl:apply-templates select="attribute()" mode="xml"/>
678 <xsl:value-of select="'&gt;'"/> 676 <xsl:value-of select="'&gt;'"/>
679 <xsl:apply-templates select="element()|text()|comment()|processing-instruction()" mode="xml"/> 677 <xsl:apply-templates select="element()|text()|comment()|processing-instruction()" mode="xml"/>
715 <xsl:value-of select="' '"/> 713 <xsl:value-of select="' '"/>
716 <xsl:value-of select="$attributeName"/> 714 <xsl:value-of select="$attributeName"/>
717 </span> 715 </span>
718 <xsl:value-of select="'=&quot;'"/> 716 <xsl:value-of select="'=&quot;'"/>
719 <span class="xml attributeValue"><xsl:value-of select="."/></span><xsl:value-of select="'&quot;'"/> 717 <span class="xml attributeValue"><xsl:value-of select="."/></span><xsl:value-of select="'&quot;'"/>
720 <xsl:apply-templates select="attribute()" mode="xml"/> 718 </xsl:template>
719
720 <xsl:template match="comment()" mode="xml">
721 <span class="xml comment">
722 <xsl:value-of select="'&lt;!-- '"/><xsl:value-of select="."/><xsl:value-of select="' --&gt;'"/>
723 </span>
724 </xsl:template>
725
726 <xsl:template match="processing-instruction()" mode="xml">
721 </xsl:template> 727 </xsl:template>
722 728
723 <!-- If ft-query is set then highlight all term occurrences in each little text piece for the fulltext query --> 729 <!-- If ft-query is set then highlight all term occurrences in each little text piece for the fulltext query -->
724 <xsl:template match="text()" mode="xml"> 730 <xsl:template match="text()" mode="xml">
725 <xsl:variable name="ancestorStr" select="concat('./ancestor::', $highlightElement)"/> 731 <xsl:variable name="ancestorStr" select="concat('./ancestor::', $highlightElement)"/>
749 </xsl:template> 755 </xsl:template>
750 756
751 757
752 <!-- variables used by templates in mode "text" --> 758 <!-- variables used by templates in mode "text" -->
753 <xsl:variable name="collectionName" select="/result/document-description/collection-name"/> 759 <xsl:variable name="collectionName" select="/result/document-description/collection-name"/>
754 <xsl:variable name="documentUri" select="/result/document-description/uri"/>
755 <xsl:variable name="documentName" select="/result/document-description/document-name"/>
756 <xsl:variable name="documentIdentifier" select="/result/document-description/identifier"/> 760 <xsl:variable name="documentIdentifier" select="/result/document-description/identifier"/>
757 <xsl:variable name="pageNumber" select="/result/page/number"/> 761 <xsl:variable name="pageNumber" select="/result/page/number"/>
758 <xsl:variable name="firstFigurePosition" select="/result/page/firstFigurePosition"/> 762 <xsl:variable name="firstFigurePosition" select="/result/page/firstFigurePosition"/>
759 <xsl:variable name="figuresImageDirectory" select="/result/page/figures-image-directory"/> 763 <xsl:variable name="figuresImageDirectory" select="/result/page/figures-image-directory"/>
760 <xsl:variable name="figures" select="/result/page/figures"/> 764 <xsl:variable name="figures" select="/result/page/figures"/>
761 <xsl:variable name="handwritten" select="/result/page/handwritten"/> 765 <xsl:variable name="handwritten" select="/result/page/handwritten"/>
762 <xsl:variable name="tables" select="/result/page/tables"/> 766 <xsl:variable name="tables" select="/result/page/tables"/>
763 <xsl:variable name="notes" select="/result/page/notes"/> 767 <xsl:variable name="notes" select="/result/page/notes"/>
764 <xsl:variable name="charNorm" select="/result/page/character-normalization"/> 768 <xsl:variable name="charNorm" select="/result/page/character-normalization"/>
765 769
770 <!-- text mode: transform to text or textPollux display -->
766 <xsl:template match="text" mode="text"> 771 <xsl:template match="text" mode="text">
767 <xsl:apply-templates mode="text"/> 772 <xsl:apply-templates mode="text"/>
768 <!-- TEI Dictionary --> 773 <!-- TEI Dictionary -->
769 <xsl:if test="not(empty(//entry))"> 774 <xsl:if test="not(empty(//entry))">
770 <xsl:for-each select="//entry"> 775 <xsl:for-each select="//entry">
805 </span> 810 </span>
806 </xsl:for-each> 811 </xsl:for-each>
807 </xsl:if> 812 </xsl:if>
808 <!-- Notes --> 813 <!-- Notes -->
809 <xsl:variable name="countEmptyPlaces" select="count($notes/note[empty(@place)])"/> 814 <xsl:variable name="countEmptyPlaces" select="count($notes/note[empty(@place)])"/>
810 <xsl:variable name="countBottomPlaces" select="count($notes/note[contains(@place, 'bottom')])"/> 815 <xsl:variable name="countBottomPlaces">
816 <xsl:choose>
817 <xsl:when test="$collectionName = 'archimedes' or $collectionName = 'tei'">
818 <xsl:value-of select="count($notes/note[contains(@place, 'bottom')])"/>
819 </xsl:when>
820 <xsl:otherwise>
821 <xsl:value-of select="count($notes/note[contains(@position, 'bottom') or empty(string(@position))])"/>
822 </xsl:otherwise>
823 </xsl:choose>
824 </xsl:variable>
811 <xsl:if test="($collectionName = 'archimedes' or $collectionName = 'tei') and count($notes/*) > 0"> 825 <xsl:if test="($collectionName = 'archimedes' or $collectionName = 'tei') and count($notes/*) > 0">
812 <div> 826 <div>
813 <xsl:choose> 827 <xsl:choose>
814 <xsl:when test="$countBottomPlaces > 0 or $countEmptyPlaces > 0"> 828 <xsl:when test="$countBottomPlaces > 0 or $countEmptyPlaces > 0">
815 <hr class="notesBottom"/> 829 <hr class="notesBottom"/>
849 </xsl:for-each> 863 </xsl:for-each>
850 </div> 864 </div>
851 </xsl:if> 865 </xsl:if>
852 <xsl:if test="$collectionName = 'echo' and count($notes/*) > 0"> 866 <xsl:if test="$collectionName = 'echo' and count($notes/*) > 0">
853 <div> 867 <div>
854 <hr class="notesBottom"/> 868 <xsl:choose>
869 <xsl:when test="$countBottomPlaces > 0 or $countEmptyPlaces > 0">
870 <hr class="notesBottom"/>
871 </xsl:when>
872 <xsl:otherwise></xsl:otherwise>
873 </xsl:choose>
855 <xsl:for-each select="$notes/echo:note"> 874 <xsl:for-each select="$notes/echo:note">
856 <xsl:variable name="label" select="string(@xlink:label)"/> 875 <xsl:variable name="label" select="string(@xlink:label)"/>
876 <xsl:variable name="place" select="@position"/>
857 <xsl:variable name="uid" select="@uid"/> 877 <xsl:variable name="uid" select="@uid"/>
858 <xsl:variable name="modificationDate" select="@modificationDate"/> 878 <xsl:variable name="modificationDate" select="@modificationDate"/>
859 <xsl:variable name="noteWithoutNamespace" select="mpdl-util:copyWithoutNamespace(.)"/> 879 <xsl:variable name="noteWithoutNamespace" select="mpdl-util:copyWithoutNamespace(.)"/>
860 <p> 880 <xsl:choose>
861 <a> 881 <xsl:when test="$place = '' or empty($place) or $place = 'bottom'">
862 <xsl:attribute name="name"><xsl:value-of select="$label"/></xsl:attribute> 882 <p>
863 <xsl:attribute name="href"><xsl:value-of select="concat(urlBase, '#', $label, 'ref')"/></xsl:attribute> 883 <a>
864 <xsl:attribute name="class"><xsl:value-of select="'note'"/></xsl:attribute> 884 <xsl:attribute name="name"><xsl:value-of select="$label"/></xsl:attribute>
865 <xsl:value-of select="$label"/> 885 <xsl:attribute name="href"><xsl:value-of select="concat(urlBase, '#', $label, 'ref')"/></xsl:attribute>
866 </a> 886 <xsl:attribute name="class"><xsl:value-of select="'note'"/></xsl:attribute>
867 <xsl:value-of select="': '"/> 887 <xsl:value-of select="$label"/>
868 <xsl:choose> 888 </a>
869 <xsl:when test="$uid = '' or empty($uid)"> 889 <xsl:value-of select="': '"/>
870 <span class="note"><xsl:apply-templates select="$noteWithoutNamespace/node()" mode="text"/></span> 890 <xsl:choose>
871 </xsl:when> 891 <xsl:when test="$uid = '' or empty($uid)">
872 <xsl:otherwise> 892 <span class="note"><xsl:apply-templates select="$noteWithoutNamespace/node()" mode="text"/></span>
873 <span class="note"><xsl:apply-templates select="$noteWithoutNamespace/node()" mode="text"/></span> 893 </xsl:when>
874 <xsl:value-of select="concat(' [external note, ', $uid, ', ', $modificationDate, ']')"/> 894 <xsl:otherwise>
875 </xsl:otherwise> 895 <span class="note"><xsl:apply-templates select="$noteWithoutNamespace/node()" mode="text"/></span>
876 </xsl:choose> 896 <xsl:value-of select="concat(' [external note, ', $uid, ', ', $modificationDate, ']')"/>
877 </p> 897 </xsl:otherwise>
898 </xsl:choose>
899 </p>
900 </xsl:when>
901 <xsl:otherwise></xsl:otherwise>
902 </xsl:choose>
878 </xsl:for-each> 903 </xsl:for-each>
879 </div> 904 </div>
880 </xsl:if> 905 </xsl:if>
881 </xsl:template> 906 </xsl:template>
882 907
896 </xsl:variable> 921 </xsl:variable>
897 <p> 922 <p>
898 <span> 923 <span>
899 <xsl:attribute name="class"><xsl:value-of select="$class"/></xsl:attribute> 924 <xsl:attribute name="class"><xsl:value-of select="$class"/></xsl:attribute>
900 <xsl:attribute name="id"><xsl:value-of select="concat('head', $currentHighlightElementPos)"/></xsl:attribute> 925 <xsl:attribute name="id"><xsl:value-of select="concat('head', $currentHighlightElementPos)"/></xsl:attribute>
926 <xsl:if test="not(empty(@identifier))"><xsl:attribute name="identifier"><xsl:value-of select="@identifier"/></xsl:attribute></xsl:if>
901 <xsl:apply-templates mode="text"/> 927 <xsl:apply-templates mode="text"/>
902 </span> 928 </span>
903 </p> 929 </p>
904 </xsl:template> 930 </xsl:template>
905 931
1171 <xsl:variable name="style" select="@style"/> 1197 <xsl:variable name="style" select="@style"/>
1172 <xsl:variable name="class"> 1198 <xsl:variable name="class">
1173 <xsl:choose> 1199 <xsl:choose>
1174 <xsl:when test="not(empty(@style)) and $highlightElementPos >= 0 and $highlightElementPos = $currentHighlightElementPos"><xsl:value-of select="concat('p highlight ', @style)"/></xsl:when> 1200 <xsl:when test="not(empty(@style)) and $highlightElementPos >= 0 and $highlightElementPos = $currentHighlightElementPos"><xsl:value-of select="concat('p highlight ', @style)"/></xsl:when>
1175 <xsl:when test="empty(@style) and $highlightElementPos >= 0 and $highlightElementPos = $currentHighlightElementPos"><xsl:value-of select="'p highlight'"/></xsl:when> 1201 <xsl:when test="empty(@style) and $highlightElementPos >= 0 and $highlightElementPos = $currentHighlightElementPos"><xsl:value-of select="'p highlight'"/></xsl:when>
1202 <xsl:when test="not(empty(@style))"><xsl:value-of select="concat('p ', @style)"/></xsl:when>
1176 <xsl:otherwise><xsl:value-of select="'p'"/></xsl:otherwise> 1203 <xsl:otherwise><xsl:value-of select="'p'"/></xsl:otherwise>
1177 </xsl:choose> 1204 </xsl:choose>
1178 </xsl:variable> 1205 </xsl:variable>
1179 <xsl:choose> 1206 <xsl:choose>
1180 <xsl:when test="not(empty($style))"> 1207 <xsl:when test="not(empty($style))">
1195 </div> 1222 </div>
1196 </xsl:otherwise> 1223 </xsl:otherwise>
1197 </xsl:choose> 1224 </xsl:choose>
1198 </xsl:template> 1225 </xsl:template>
1199 1226
1200 <xsl:template match="lb" mode="text"> 1227 <xsl:template match="lb|br" mode="text">
1201 <xsl:variable name="withoutLBs"> 1228 <xsl:variable name="withoutLBs">
1202 <xsl:choose> 1229 <xsl:choose>
1203 <xsl:when test="contains($options, 'withoutLBs')"><xsl:value-of select="'true'"/></xsl:when> 1230 <xsl:when test="contains($options, 'withoutLBs')"><xsl:value-of select="'true'"/></xsl:when>
1204 <xsl:otherwise><xsl:value-of select="'false'"/></xsl:otherwise> 1231 <xsl:otherwise><xsl:value-of select="'false'"/></xsl:otherwise>
1205 </xsl:choose> 1232 </xsl:choose>
1226 </xsl:choose> 1253 </xsl:choose>
1227 </xsl:template> 1254 </xsl:template>
1228 1255
1229 <xsl:template match="note" mode="text"> 1256 <xsl:template match="note" mode="text">
1230 <xsl:variable name="hasLabel" select="string(@xlink:label) != ''"/> 1257 <xsl:variable name="hasLabel" select="string(@xlink:label) != ''"/>
1231 <xsl:variable name="place" select="@place"/> 1258 <xsl:variable name="place">
1259 <xsl:choose>
1260 <xsl:when test="$collectionName = 'tei'"><xsl:value-of select="@place"/></xsl:when>
1261 <xsl:otherwise><xsl:value-of select="@position"/></xsl:otherwise>
1262 </xsl:choose>
1263 </xsl:variable>
1232 <xsl:variable name="notePos" select="count(preceding::note[. >> $topPB]) + 1"/> 1264 <xsl:variable name="notePos" select="count(preceding::note[. >> $topPB]) + 1"/>
1233 <xsl:variable name="href" select="concat('note-', $pageNumber, '-', $notePos)"/> 1265 <xsl:variable name="href" select="concat('note-', $pageNumber, '-', $notePos)"/>
1234 <xsl:choose> 1266 <xsl:choose>
1235 <xsl:when test="$collectionName = 'archimedes'"> 1267 <xsl:when test="$collectionName = 'archimedes'">
1236 <a> 1268 <a>
1238 <xsl:attribute name="href"><xsl:value-of select="concat(urlBase, '#', $href)"/></xsl:attribute> 1270 <xsl:attribute name="href"><xsl:value-of select="concat(urlBase, '#', $href)"/></xsl:attribute>
1239 <xsl:attribute name="class"><xsl:value-of select="'noteRef super'"/></xsl:attribute> 1271 <xsl:attribute name="class"><xsl:value-of select="'noteRef super'"/></xsl:attribute>
1240 <xsl:value-of select="$href"/> 1272 <xsl:value-of select="$href"/>
1241 </a> 1273 </a>
1242 </xsl:when> 1274 </xsl:when>
1275 <xsl:when test="$collectionName = 'echo' and not($hasLabel) and not(empty($place))">
1276 <span>
1277 <xsl:attribute name="class"><xsl:value-of select="concat('note margin ', $place)"/></xsl:attribute>
1278 <xsl:apply-templates mode="text"/>
1279 </span>
1280 </xsl:when>
1243 <xsl:when test="$collectionName = 'echo' and not($hasLabel)"> 1281 <xsl:when test="$collectionName = 'echo' and not($hasLabel)">
1244 <p> 1282 <p>
1245 <xsl:value-of select="'[Note]: '"/> 1283 <xsl:value-of select="'[Note]: '"/>
1246 <span class="note"><xsl:apply-templates mode="text"/></span> 1284 <span class="note"><xsl:apply-templates mode="text"/></span>
1247 </p> 1285 </p>
1248 </xsl:when> 1286 </xsl:when>
1287 <xsl:when test="$collectionName = 'echo' and $hasLabel"></xsl:when>
1249 <xsl:when test="$collectionName = 'tei'"> 1288 <xsl:when test="$collectionName = 'tei'">
1250 <xsl:choose> 1289 <xsl:choose>
1251 <xsl:when test="contains($place, 'margin')"> 1290 <xsl:when test="contains($place, 'margin')">
1252 <span> 1291 <span>
1253 <xsl:attribute name="class"><xsl:value-of select="concat('note ', $place)"/></xsl:attribute> 1292 <xsl:attribute name="class"><xsl:value-of select="concat('note ', $place)"/></xsl:attribute>
1488 <xsl:when test="$type = 'table'"> 1527 <xsl:when test="$type = 'table'">
1489 <xsl:variable name="table" select="$tables/xhtml:table[@xlink:label = $href]"/> 1528 <xsl:variable name="table" select="$tables/xhtml:table[@xlink:label = $href]"/>
1490 <xsl:sequence select="mpdl-util:copyWithoutNamespace($table)"/> 1529 <xsl:sequence select="mpdl-util:copyWithoutNamespace($table)"/>
1491 </xsl:when> 1530 </xsl:when>
1492 <xsl:when test="$type = 'note'"> 1531 <xsl:when test="$type = 'note'">
1493 <a> 1532 <xsl:variable name="note" select="$notes/echo:note[@xlink:label = $href]"/>
1494 <xsl:attribute name="name"><xsl:value-of select="concat($href, 'ref')"/></xsl:attribute> 1533 <xsl:variable name="noteWithoutNamespace" select="mpdl-util:copyWithoutNamespace($note)"/>
1495 <xsl:attribute name="href"><xsl:value-of select="concat(urlBase, '#', $href)"/></xsl:attribute> 1534 <xsl:variable name="place" select="$note/@position"/>
1496 <xsl:attribute name="class"><xsl:value-of select="'noteRef super'"/></xsl:attribute> 1535 <xsl:choose>
1497 <xsl:value-of select="$href"/> 1536 <xsl:when test="not(empty($place))">
1498 </a> 1537 <span>
1538 <xsl:attribute name="class"><xsl:value-of select="concat('note margin ', $place)"/></xsl:attribute>
1539 <xsl:apply-templates select="$noteWithoutNamespace/node()" mode="text"/>
1540 </span>
1541 </xsl:when>
1542 <xsl:otherwise>
1543 <a>
1544 <xsl:attribute name="name"><xsl:value-of select="concat($href, 'ref')"/></xsl:attribute>
1545 <xsl:attribute name="href"><xsl:value-of select="concat(urlBase, '#', $href)"/></xsl:attribute>
1546 <xsl:attribute name="class"><xsl:value-of select="'noteRef super'"/></xsl:attribute>
1547 <xsl:value-of select="$href"/>
1548 </a>
1549 </xsl:otherwise>
1550 </xsl:choose>
1499 </xsl:when> 1551 </xsl:when>
1500 <xsl:otherwise><a><xsl:attribute name="href"><xsl:value-of select="$href"/></xsl:attribute><xsl:apply-templates mode="text"/></a></xsl:otherwise> 1552 <xsl:otherwise><a><xsl:attribute name="href"><xsl:value-of select="$href"/></xsl:attribute><xsl:apply-templates mode="text"/></a></xsl:otherwise>
1501 </xsl:choose> 1553 </xsl:choose>
1502 </xsl:template> 1554 </xsl:template>
1503 1555
1700 <xsl:choose> 1752 <xsl:choose>
1701 <!-- Show the sentence in color light grey if it is given as sn or highlightElem --> 1753 <!-- Show the sentence in color light grey if it is given as sn or highlightElem -->
1702 <xsl:when test="($sn >= 0 and $sn = $currentSN) or ($highlightElement = 's' and $highlightElementPos >= 0 and $highlightElementPos = $currentSN)"> 1754 <xsl:when test="($sn >= 0 and $sn = $currentSN) or ($highlightElement = 's' and $highlightElementPos >= 0 and $highlightElementPos = $currentSN)">
1703 <span class="s highlight" id="s{$currentSN}"> 1755 <span class="s highlight" id="s{$currentSN}">
1704 <xsl:if test="not(empty(@xmlNodeId))"><xsl:attribute name="xmlNodeId"><xsl:value-of select="@xmlNodeId"/></xsl:attribute></xsl:if> 1756 <xsl:if test="not(empty(@xmlNodeId))"><xsl:attribute name="xmlNodeId"><xsl:value-of select="@xmlNodeId"/></xsl:attribute></xsl:if>
1757 <xsl:if test="not(empty(@identifier))"><xsl:attribute name="identifier"><xsl:value-of select="@identifier"/></xsl:attribute></xsl:if>
1705 <xsl:choose> 1758 <xsl:choose>
1706 <xsl:when test="empty(@style)"> 1759 <xsl:when test="empty(@style)">
1707 <xsl:apply-templates mode="text"/> 1760 <xsl:apply-templates mode="text"/>
1708 </xsl:when> 1761 </xsl:when>
1709 <xsl:otherwise> 1762 <xsl:otherwise>
1713 </span> 1766 </span>
1714 </xsl:when> 1767 </xsl:when>
1715 <xsl:otherwise> 1768 <xsl:otherwise>
1716 <span class="s" id="s{$currentSN}"> 1769 <span class="s" id="s{$currentSN}">
1717 <xsl:if test="not(empty(@xmlNodeId))"><xsl:attribute name="xmlNodeId"><xsl:value-of select="@xmlNodeId"/></xsl:attribute></xsl:if> 1770 <xsl:if test="not(empty(@xmlNodeId))"><xsl:attribute name="xmlNodeId"><xsl:value-of select="@xmlNodeId"/></xsl:attribute></xsl:if>
1771 <xsl:if test="not(empty(@identifier))"><xsl:attribute name="identifier"><xsl:value-of select="@identifier"/></xsl:attribute></xsl:if>
1718 <xsl:choose> 1772 <xsl:choose>
1719 <xsl:when test="empty(@style)"> 1773 <xsl:when test="empty(@style)">
1720 <xsl:apply-templates mode="text"/> 1774 <xsl:apply-templates mode="text"/>
1721 </xsl:when> 1775 </xsl:when>
1722 <xsl:otherwise> 1776 <xsl:otherwise>