Project

General

Profile

« Previous | Next » 

Revision 7405

rework simple log stats so that there is no saxon requirement (xslt 2)

View differences:

lib/style/common/log.xsl
27 27
	<xsl:param name="cgi-prefix" />
28 28
	<xsl:param name="simple">true</xsl:param>
29 29
	
30
		
31
	<xsl:key name="docIds" match="/log/logEntry/docid/text()" use="." />
30 32
	
31
	<xsl:variable name="this" select="/"/>
32
	
33 33
	<xsl:template match="/">
34 34
		<html>
35 35
			<head>
......
45 45
			
46 46
				<xsl:choose>
47 47
					<xsl:when test="$simple='true'">
48
						Views:
49
						<xsl:for-each select="distinct-values(./log/logEntry/docid)" >
50
							<xsl:variable name="uniqueDocid" select="string(.)"/>
51
							<xsl:value-of select="count($this/log/logEntry[docid=$uniqueDocid and event='read'])" />
52
						</xsl:for-each>	
48
						<xsl:for-each select="./log/logEntry/docid/text()[generate-id(.)=generate-id(key('docIds',.)[1])]">
49
							<xsl:variable name="uniqueDocid" select="."/>
50
							Views: <xsl:value-of select="count(//log/logEntry[docid=$uniqueDocid and event='read'])" />														
51
						</xsl:for-each>						
53 52
					</xsl:when>
54 53
					<xsl:otherwise>
55 54
						<table class="subGroup subGroup_border">
56 55
							
57
							<xsl:for-each select="distinct-values(./log/logEntry/docid)" >
56
							<xsl:for-each select="./log/logEntry/docid/text()[generate-id()=generate-id(key('docIds',.)[1])]">
58 57
								<xsl:variable name="uniqueDocid" select="string(.)"/>
59 58
								<tr>
60 59
									<th colspan="2">
......
66 65
										Doc Id:
67 66
									</td>
68 67
									<td>	 
69
										<xsl:value-of select="$uniqueDocid" />
68
										<xsl:value-of select="$uniqueDocid" />										
70 69
									</td>
71 70
								</tr>
72 71
								<tr>
......
74 73
										Read:
75 74
									</td>
76 75
									<td>	 
77
										<xsl:value-of select="count($this/log/logEntry[docid=$uniqueDocid and event='read'])" />
76
										<xsl:value-of select="count(//log/logEntry[docid=$uniqueDocid and string(event)='read'])" />
78 77
									</td>
79 78
								</tr>
80 79
								<tr>
......
82 81
										Insert: 
83 82
									</td>
84 83
									<td>	
85
										<xsl:value-of select="count($this/log/logEntry[docid=$uniqueDocid and event='insert'])" />
84
										<xsl:value-of select="count(//log/logEntry[docid=$uniqueDocid and string(event)='insert'])" />
86 85
									</td>
87 86
								</tr>
88 87
								<tr>
......
90 89
										Update: 
91 90
									</td>
92 91
									<td>	
93
										<xsl:value-of select="count($this/log/logEntry[docid=$uniqueDocid and event='update'])" />
92
										<xsl:value-of select="count(//log/logEntry[docid=$uniqueDocid and string(event)='update'])" />
94 93
									</td>
95 94
								</tr>
96 95
								<tr>
......
98 97
										Delete: 
99 98
									</td>
100 99
									<td>	
101
										<xsl:value-of select="count($this/log/logEntry[docid=$uniqueDocid and event='delete'])" />
100
										<xsl:value-of select="count(//log/logEntry[docid=$uniqueDocid and event/text() = 'delete'])" />
102 101
									</td>
103 102
								</tr>
104 103
								<tr>
105 104
									<td>
105
										Other: 
106
									</td>
107
									<td>	
108
										<xsl:value-of select="count(//log/logEntry[docid=$uniqueDocid and (event/text() != 'read' and event/text() != 'insert' and event/text() != 'update' and event/text() != 'delete')])" />
109
									</td>
110
								</tr>
111
								<tr>
112
									<td>
106 113
										Total: 
107 114
									</td>
108 115
									<td>	
109
										<xsl:value-of select="count($this/log/logEntry[docid=$uniqueDocid])" />
116
										<xsl:value-of select="count(//log/logEntry[docid=$uniqueDocid])" />
110 117
									</td>
111 118
								</tr>
112 119
								

Also available in: Unified diff