comparison software/eXist/webapp/mpdl/_stuff/oxygen-projects/monte-project/archimedes-image-fragment.xsl @ 7:5589d865af7a

Erstellung XQL/XSL Applikation
author Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
date Tue, 08 Feb 2011 15:16:46 +0100
parents
children
comparison
equal deleted inserted replaced
6:2396a569e446 7:5589d865af7a
1 <xsl:stylesheet version="1.0"
2 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 xmlns:xlink="http://www.w3.org/1999/xlink">
4
5 <xsl:output method="html"/>
6
7 <xsl:template match="result">
8 <html><body>
9 <xsl:variable name="ft-query-name" select="/result/ft-query/name"/>
10 <xsl:for-each select="document-description">
11 <h2>
12 <xsl:for-each select="info">
13 <xsl:value-of select="author"/>.
14 <xsl:value-of select="title"/>.
15 <xsl:value-of select="place"/>,
16 <xsl:value-of select="date"/>
17 </xsl:for-each>
18 </h2>
19 </xsl:for-each>
20 <xsl:for-each select="page">
21 <xsl:variable name="documentName" select="/result/document-description/document-name"/>
22 <xsl:variable name="countPages" select="/result/document-description/count-pages"/>
23 <xsl:variable name="number" select="number"/>
24 <xsl:variable name="ftQueryName" select="/result/ft-query/name"/>
25 <xsl:variable name="documentValue" select="concat('document=', $documentName)"/>
26 <xsl:variable name="pnValue" select="concat('pn=', $number)"/>
27 <xsl:variable name="modeImageValue" select="concat('mode=', 'image')"/>
28 <xsl:variable name="modeXmlValue" select="concat('mode=', 'xml')"/>
29 <xsl:variable name="modeTextValue" select="concat('mode=', 'text')"/>
30 <xsl:variable name="ftQueryStr" select="concat('&amp;', 'ft-query=', $ftQueryName)"/>
31 <xsl:variable name="ftQueryValue">
32 <xsl:choose>
33 <xsl:when test="/result/ft-query[node()]"><xsl:value-of select="$ftQueryStr"/></xsl:when>
34 <xsl:otherwise><xsl:value-of select="''"/></xsl:otherwise>
35 </xsl:choose>
36 </xsl:variable>
37 <xsl:variable name="imageLink" select="concat($documentValue, '&amp;', $pnValue, '&amp;', $modeImageValue, $ftQueryValue)"/>
38 <xsl:variable name="textLink" select="concat($documentValue, '&amp;', $pnValue, '&amp;', $modeTextValue, $ftQueryValue)"/>
39 <xsl:variable name="xmlLink" select="concat($documentValue, '&amp;', $pnValue, '&amp;', $modeXmlValue, $ftQueryValue)"/>
40 <form action="" method="get"></form>
41 <table width="100%">
42 <colgroup>
43 <col width="30%"/>
44 <col width="70%"/>
45 </colgroup>
46 <tr>
47 <td align="left" nowrap="true">
48 [<a href="?{$textLink}">Text</a>]
49 [Image]
50 [<a href="?{$xmlLink}">XML</a>]
51 </td>
52 <td nowrap="true">
53 <td align="right">
54 <xsl:choose>
55 <xsl:when test="$number &gt; 1">
56 <a href="?{$documentValue}&amp;pn={$number - 1}&amp;{$modeImageValue}{$ftQueryValue}"><img src="images/left.gif" alt="page-down" border="0"/></a>
57 </xsl:when>
58 <xsl:otherwise>
59 <a href="?{$imageLink}"><img src="images/left.gif" alt="page-down" border="0"/></a>
60 </xsl:otherwise>
61 </xsl:choose>
62 </td>
63 <td nowrap="true">
64 <xsl:value-of select="$number"/> / <xsl:value-of select="$countPages"/>
65 </td>
66 <td>
67 <xsl:choose>
68 <xsl:when test="$number &lt; $countPages">
69 <a href="?{$documentValue}&amp;pn={$number + 1}&amp;{$modeImageValue}{$ftQueryValue}"><img src="images/right.gif" alt="page-up" border="0"/></a>
70 </xsl:when>
71 <xsl:otherwise>
72 <a href="?{$imageLink}"><img src="images/right.gif" alt="page-down" border="0"/></a>
73 </xsl:otherwise>
74 </xsl:choose>
75 </td>
76 <td nowrap="true">
77 <input type="hidden" name="document" value="{$documentName}"/>
78 Page: <input type="text" size="3" name="pn" value="{$number}"/>
79 <input type="hidden" name="mode" value="image"/>
80 </td>
81 </td>
82 </tr>
83 </table>
84 <hr/>
85 <xsl:variable name="linkImageEcho" select="/result/page/image-echo"/>
86 <xsl:variable name="linkImageScaler" select="/result/page/image-scaler"/>
87 <table align="middle" width="100%">
88 <colgroup>
89 <col width="10%"/>
90 <col width="60%"/>
91 <col width="30%"/>
92 </colgroup>
93 <tr>
94 <td/>
95 <td align="left" valign="top">
96 <a href="{$linkImageEcho}"><img alt="Page image: {$number}" src="{$linkImageScaler}&amp;dh=600" border="1"/></a>
97 </td>
98 <xsl:if test="$ftQueryValue!=''">
99 <td align="left" valign="top">
100 <b><xsl:value-of select="/result/ft-query/result/size"/> Hits: "<xsl:value-of select="$ftQueryName"/>"</b>
101 <ol>
102 <xsl:for-each select="/result/ft-query/result/hits/hit">
103 <li>
104 <xsl:variable name="hitPN" select="pn"/>
105 <xsl:variable name="hitPosOfS" select="pos-of-s"/>
106 <a href="?{$documentValue}&amp;pn={$hitPN}&amp;{$modeImageValue}{$ftQueryValue}">Page <xsl:value-of select="$hitPN"/>, Sentence <xsl:value-of select="$hitPosOfS"/></a>
107 </li>
108 </xsl:for-each>
109 </ol>
110 </td>
111 </xsl:if>
112 </tr>
113 </table>
114 </xsl:for-each>
115 <hr/>
116 <xsl:for-each select="document-description">
117 Elapsed time: <xsl:value-of select="performance"/> ms, Back to <a href="query.xql">query page</a>, see the <a href="page-query-result.xql?_source=yes">XQuery source</a> and <a href="/exist/rest/db/xsl/archimedes-image-fragment.xsl?_source=yes">XSL source</a> of this page
118 </xsl:for-each>
119 </body></html>
120 </xsl:template>
121
122 </xsl:stylesheet>