-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprofilesampletext.xsl
134 lines (128 loc) · 5.58 KB
/
profilesampletext.xsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:html="http://www.w3.org/1999/xhtml" version="1.0" exclude-result-prefixes="html">
<xsl:output method="html"/>
<xsl:template match="/">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<style>
td
{
height: 20px;
}
</style>
<script language="Javascript">
function mi(t_) {
t_.style.background = 'rgb(136,136,255)';
t_.style.color = 'white';
t_.style.cursor ="pointer";
}
function mo(t_) {
t_.style.background = 'white';
t_.style.color = 'black';
t_.style.cursor ="default";
}
function showWC(t_) {
ob4 = document.getElementById('dvWC');
if (ob4) {
ob4.innerHTML = t_;
}
}
function showTrans(t_) {
ob4 = document.getElementById('dvTrans');
if (ob4) {
ob4.innerHTML = t_;
}
}
function showUsage(t_) {
ob4 = document.getElementById('dvUsage');
if (ob4) {
ob4.innerHTML = t_;
}
}
function addUsage(t_) {
ob4 = document.getElementById('dvUsage');
if (ob4) {
ob4.innerHTML = ob4.innerHTML + t_;
}
}
function showLemma(t_) {
ob4 = document.getElementById('dvLemma');
if (ob4) {
ob4.innerHTML = t_;
}
}
</script>
<table style="position: absolute; left: 10px; top: 10px; border-collapse: collapse; background:rgb(211,211,211); 
 border:1px solid rgb(95,95,95)">
<tr>
<td style="width:100px">
<b>Word class: </b>
</td>
<td style="width:200px">
<i id="dvWC" style="color:rgb(154,5,69)"/>
</td>
</tr>
<tr>
<td>
<b>Lemma: </b>
</td>
<td>
<i id="dvLemma" style="color:rgb(2,37,157)"/>
</td>
</tr>
<tr>
<td>
<b>Translation: </b>
</td>
<td>
<i id="dvTrans" style="color:rgb(60,124,1)"/>
</td>
</tr>
<tr>
<td>
<b>Usage: </b>
</td>
<td>
<i id="dvUsage" style="color:rgb(60,124,1)"/>
</td>
</tr>
</table>
<table style="position: absolute; left: 10px; top: 110px; ">
<tr>
<td colspan="2">
<h3>Sample Text</h3>
<xsl:for-each select="//s">
<div class="profiletext">
<xsl:value-of select="position()"/>.
<xsl:for-each select=".//w | .//c">
<span onMouseMove="mi(this)" onMouseout="mo(this)">
<xsl:choose>
<xsl:when test="name()='w'">
<xsl:attribute name="onMouseMove">
mi(this);
showWC('<xsl:value-of select="./fs/f[@name='pos']"/>');
showLemma('<xsl:value-of select="./fs/f[@name='lemma']"/>');
showTrans('<xsl:value-of select="./fs/f[@name='translation']"/>');
showUsage('<xsl:value-of select="./fs/f[@name='usage']"/>');
<xsl:if test="./fs/f[@name='tense']">addUsage('<xsl:value-of select="./fs/f[@name='tense']"/> tense');</xsl:if>
<xsl:if test="./fs/f[@name='person']">addUsage(', <xsl:value-of select="./fs/f[@name='person']"/>-');</xsl:if>
<xsl:if test="./fs/f[@name='number']">addUsage('<xsl:value-of select="./fs/f[@name='number']"/>');</xsl:if>
</xsl:attribute>
<xsl:value-of select="./fs/f[@name='wordform']"/>
</xsl:when>
<xsl:when test="name()='c'">
<xsl:attribute name="onMouseMove">
mi(this);showWC('');showLemma('');showTrans('');showUsage('');
</xsl:attribute>
<xsl:value-of select="."/>
</xsl:when>
</xsl:choose>
</span>
</xsl:for-each>
</div>
</xsl:for-each>
</td>
</tr>
</table>
</html>
</xsl:template>
</xsl:stylesheet>