]> CyberLeo.Net >> Repos - FreeBSD/releng/9.3.git/blob - contrib/bind9/bin/named/bind9.ver3.xsl
Copy stable/9 to releng/9.3 as part of the 9.3-RELEASE cycle.
[FreeBSD/releng/9.3.git] / contrib / bind9 / bin / named / bind9.ver3.xsl
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  - Copyright (C) 2012-2014  Internet Systems Consortium, Inc. ("ISC")
4  -
5  - Permission to use, copy, modify, and/or distribute this software for any
6  - purpose with or without fee is hereby granted, provided that the above
7  - copyright notice and this permission notice appear in all copies.
8  -
9  - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10  - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11  - AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12  - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13  - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14  - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15  - PERFORMANCE OF THIS SOFTWARE.
16 -->
17
18 <!-- $Id$ -->
19
20 <!-- %Id: bind9.xsl,v 1.21 2009/01/27 23:47:54 tbox Exp % -->
21 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0">
22   <xsl:output method="html" indent="yes" version="4.0"/>
23   <xsl:template match="statistics[@version=&quot;3.3&quot;]">
24     <html>
25       <head>
26         <xsl:if test="system-property('xsl:vendor')!='Transformiix'">
27           <!-- Non Mozilla specific markup -->
28           <script type="text/javascript" src="https://www.google.com/jsapi"/>
29           <script type="text/javascript">
30
31         google.load("visualization", "1", {packages:["corechart"]});
32         google.setOnLoadCallback(loadGraphs);
33
34         var graphs=[];
35
36         function drawChart(chart_title,target,style,data) {
37           var data = google.visualization.arrayToDataTable(data);
38
39           var options = {
40             title: chart_title
41           };
42
43           var chart;
44           if (style == "barchart") {
45             chart = new google.visualization.BarChart(document.getElementById(target));
46             chart.draw(data, options);
47           } else if (style == "piechart") {
48             chart = new google.visualization.PieChart(document.getElementById(target));
49             chart.draw(data, options);
50           }
51         }
52
53         function loadGraphs(){
54           var g;
55
56           while(g = graphs.shift()){
57             // alert("going for: " + g.target);
58             if(g.data.length > 1){
59               drawChart(g.title,g.target,g.style,g.data);
60             }
61           }
62         }
63
64         // Server Incoming Query Types         
65         graphs.push({
66                      'title' : "Server Incoming Query Types",
67                      'target': 'chart_incoming_qtypes',
68                      'style': 'barchart',
69                      'data': [['Type','Counter'],<xsl:for-each select="server/counters[@type=&quot;qtype&quot;]/counter">['<xsl:value-of select="@name"/>',<xsl:value-of select="."/>],</xsl:for-each>]
70                      });
71
72         // Server Incoming Requests by opcode
73         graphs.push({
74                      'title' : "Server Incoming Requests by DNS Opcode",
75                      'target': 'chart_incoming_opcodes',
76                      'style': 'barchart',
77                      'data': [['Opcode','Counter'],<xsl:for-each select="server/counters[@type=&quot;opcode&quot;]/counter[. &gt; 0 or substring(@name,1,3) != 'RES']">['<xsl:value-of select="@name"/>',<xsl:value-of select="."/>],</xsl:for-each>]});
78       </script>
79         </xsl:if>
80         <style type="text/css">
81      body {
82       font-family: sans-serif;
83       background-color: #ffffff;
84       color: #000000;
85       font-size: 10pt;
86      }
87
88      .odd{
89       background-color: #f0f0f0;
90      }
91
92      .even{
93       background-color: #ffffff;
94      }
95
96      p.footer{
97       font-style:italic;
98       color: grey;
99      }
100
101      table {
102       border-collapse: collapse;
103       border: 1px solid grey;
104      }
105
106      table.counters{
107       border: 1px solid grey;
108       width: 500px;
109      }
110      table.counters th {
111       text-align: right;
112       border: 1px solid grey;
113       width: 150px;
114      }
115      table.counters td {
116       text-align: right;
117       font-family: monospace;
118      }
119      table.counters tr:hover{
120       background-color: #99ddff;
121      }
122
123      table.info {
124       border: 1px solid grey;
125       width: 500px;
126      }
127      table.info th {
128       text-align: center;
129       border: 1px solid grey;
130       width: 150px;
131      }
132      table.info td {
133       text-align: center;
134      }
135      table.info tr:hover{
136       background-color: #99ddff;
137      }
138
139      table.tasks {
140       border: 1px solid grey;
141       width: 500px;
142      }
143      table.tasks th {
144       text-align: center;
145       border: 1px solid grey;
146       width: 150px;
147      }
148      table.tasks td {
149       text-align: right;
150       font-family: monospace;
151      }
152      table.tasks td:nth-child(2) {
153       text-align: center;
154      }
155      table.tasks td:nth-child(4) {
156       text-align: center;
157      }
158      table.tasks tr:hover{
159       background-color: #99ddff;
160      }
161
162      table.netstat {
163       border: 1px solid grey;
164       width: 500px;
165      }
166      table.netstat th {
167       text-align: center;
168       border: 1px solid grey;
169       width: 150px;
170      }
171      table.netstat td {
172       text-align: center;
173      }
174      table.netstat td:nth-child(4) {
175       text-align: right;
176       font-family: monospace;
177      }
178      table.netstat td:nth-child(7) {
179       text-align: left;
180      }
181      table.netstat tr:hover{
182       background-color: #99ddff;
183      }
184
185      table.mctx  {
186       border: 1px solid grey;
187       width: 500px;
188      }
189      table.mctx th {
190       text-align: center;
191       border: 1px solid grey;
192      }
193      table.mctx td {
194       text-align: right;
195       font-family: monospace;
196      }
197      table.mctx td:nth-child(-n+2) {
198       text-align: left;
199       width: 100px;
200      }
201      table.mctx tr:hover{
202       background-color: #99ddff;
203      }
204
205      .totals {
206       background-color: rgb(1,169,206);
207       color: #ffffff;
208      }
209
210      td, th {
211       padding-right: 5px;
212       padding-left: 5px;
213       border: 1px solid grey;
214      }
215
216      .header h1 {
217       color: rgb(1,169,206);
218       padding: 0px;
219      }
220
221      .content {
222       background-color: #ffffff;
223       color: #000000;
224       padding: 4px;
225      }
226
227      .item {
228       padding: 4px;
229       text-align: right;
230      }
231
232      .value {
233       padding: 4px;
234       font-weight: bold;
235      }
236
237
238      h2 {
239        color: grey;
240        font-size: 14pt;
241        width:500px;
242        text-align:center;
243      }
244
245      h3 {
246        color: #444444;
247        font-size: 12pt;
248        width:500px;
249        text-align:center;
250      }
251      h4 {
252         color:  rgb(1,169,206);
253         font-size: 10pt;
254        width:500px;
255        text-align:center;
256      }
257
258      .pie {
259       width:500px;
260       height: 500px;
261      }
262
263       </style>
264         <title>ISC BIND 9 Statistics</title>
265       </head>
266       <body>
267         <div class="header">
268           <h1>ISC Bind 9 Configuration and Statistics</h1>
269         </div>
270         <hr/>
271         <h2>Server Times</h2>
272         <table class="info">
273           <tr>
274             <th>Boot time:</th>
275             <td>
276               <xsl:value-of select="server/boot-time"/>
277             </td>
278           </tr>
279           <tr>
280             <th>Current time:</th>
281             <td>
282               <xsl:value-of select="server/current-time"/>
283             </td>
284           </tr>
285         </table>
286         <br/>
287         <xsl:if test="server/counters[@type=&quot;opcode&quot;]/counter[. &gt; 0]">
288           <xsl:if test="system-property('xsl:vendor')!='Transformiix'">
289             <h2>Incoming Requests by DNS Opcode</h2>
290             <!-- Non Mozilla specific markup -->
291             <div class="pie" id="chart_incoming_opcodes">
292               [cannot display chart]
293             </div>
294           </xsl:if>
295           <table class="counters">
296             <xsl:for-each select="server/counters[@type=&quot;opcode&quot;]/counter[. &gt; 0 or substring(@name,1,3) != 'RES']">
297               <xsl:sort select="." data-type="number" order="descending"/>
298               <tr>
299                 <th>
300                   <xsl:value-of select="@name"/>
301                 </th>
302                 <td>
303                   <xsl:value-of select="."/>
304                 </td>
305               </tr>
306             </xsl:for-each>
307             <tr>
308               <th class="totals">Total:</th>
309               <td class="totals">
310                 <xsl:value-of select="sum(server/counters[@type=&quot;opcode&quot;]/counter)"/>
311               </td>
312             </tr>
313           </table>
314           <br/>
315         </xsl:if>
316         <xsl:if test="server/counters[@type=&quot;qtype&quot;]/counter">
317           <xsl:if test="system-property('xsl:vendor')!='Transformiix'">
318             <!-- Non Mozilla specific markup -->
319             <h3>Incoming Queries by Query Type</h3>
320             <div class="pie" id="chart_incoming_qtypes">
321               [cannot display chart]
322             </div>
323           </xsl:if>
324           <table class="counters">
325             <xsl:for-each select="server/counters[@type=&quot;qtype&quot;]/counter">
326               <xsl:sort select="." data-type="number" order="descending"/>
327               <xsl:variable name="css-class">
328                 <xsl:choose>
329                   <xsl:when test="position() mod 2 = 0">even</xsl:when>
330                   <xsl:otherwise>odd</xsl:otherwise>
331                 </xsl:choose>
332               </xsl:variable>
333               <tr class="{$css-class}">
334                 <th>
335                   <xsl:value-of select="@name"/>
336                 </th>
337                 <td>
338                   <xsl:value-of select="."/>
339                 </td>
340               </tr>
341             </xsl:for-each>
342             <tr>
343               <th class="totals">Total:</th>
344               <td class="totals">
345                 <xsl:value-of select="sum(server/counters[@type=&quot;qtype&quot;]/counter)"/>
346               </td>
347             </tr>
348           </table>
349           <br/>
350         </xsl:if>
351         <xsl:if test="views/view[count(counters[@type=&quot;resqtype&quot;]/counter) &gt; 0]">
352           <h2>Outgoing Queries per view</h2>
353           <xsl:for-each select="views/view[count(counters[@type=&quot;resqtype&quot;]/counter) &gt; 0]">
354             <h3>View <xsl:value-of select="@name"/></h3>
355             <xsl:if test="system-property('xsl:vendor')!='Transformiix'">
356               <!-- Non Mozilla specific markup -->
357             <script type="text/javascript">
358                   graphs.push({
359                                 'title': "Outgoing Queries for view: <xsl:value-of select="@name"/>",
360                                 'target': 'chart_outgoing_queries_view_<xsl:value-of select="@name"/>',
361                                 'style': 'barchart',
362                                 'data': [['Type','Counter'],<xsl:for-each select="counters[@type=&quot;resqtype&quot;]/counter">['<xsl:value-of select="@name"/>',<xsl:value-of select="."/>],</xsl:for-each>]
363                                 });
364               </script>
365             <xsl:variable name="target">
366               <xsl:value-of select="@name"/>
367             </xsl:variable>
368               <div class="pie" id="chart_outgoing_queries_view_{$target}">[no data to display]</div>
369             </xsl:if>
370             <table class="counters">
371               <xsl:for-each select="counters[@type=&quot;resqtype&quot;]/counter">
372                 <xsl:sort select="." data-type="number" order="descending"/>
373                 <xsl:variable name="css-class1">
374                   <xsl:choose>
375                     <xsl:when test="position() mod 2 = 0">even</xsl:when>
376                     <xsl:otherwise>odd</xsl:otherwise>
377                   </xsl:choose>
378                 </xsl:variable>
379                 <tr class="{$css-class1}">
380                   <th>
381                     <xsl:value-of select="@name"/>
382                   </th>
383                   <td>
384                     <xsl:value-of select="."/>
385                   </td>
386                 </tr>
387               </xsl:for-each>
388             </table>
389             <br/>
390           </xsl:for-each>
391         </xsl:if>
392         <xsl:if test="server/counters[@type=&quot;nsstat&quot;]/counter[.&gt;0]">
393           <h2>Server Statistics</h2>
394           <xsl:if test="system-property('xsl:vendor')!='Transformiix'">
395             <!-- Non Mozilla specific markup -->
396           <script type="text/javascript">
397                   graphs.push({
398                                 'title' : "Server Counters",
399                                 'target': 'chart_server_nsstat_restype',
400                                 'style': 'barchart',
401                                 'data': [['Type','Counter'],<xsl:for-each select="server/counters[@type=&quot;nsstat&quot;]/counter[.&gt;0]">['<xsl:value-of select="@name"/>',<xsl:value-of select="."/>],</xsl:for-each>]
402                                 });
403               </script>
404             <div class="pie" id="chart_server_nsstat_restype">[no data to display]</div>
405           </xsl:if>
406           <table class="counters">
407             <xsl:for-each select="server/counters[@type=&quot;nsstat&quot;]/counter[.&gt;0]">
408               <xsl:sort select="." data-type="number" order="descending"/>
409               <xsl:variable name="css-class2">
410                 <xsl:choose>
411                   <xsl:when test="position() mod 2 = 0">even</xsl:when>
412                   <xsl:otherwise>odd</xsl:otherwise>
413                 </xsl:choose>
414               </xsl:variable>
415               <tr class="{$css-class2}">
416                 <th>
417                   <xsl:value-of select="@name"/>
418                 </th>
419                 <td>
420                   <xsl:value-of select="."/>
421                 </td>
422               </tr>
423             </xsl:for-each>
424           </table>
425           <br/>
426         </xsl:if>
427         <xsl:if test="server/counters[@type=&quot;zonestat&quot;]/counter[.&gt;0]">
428           <xsl:if test="system-property('xsl:vendor')!='Transformiix'">
429             <h2>Zone Maintenance Statistics</h2>
430             <script type="text/javascript">
431                   graphs.push({
432                                 'title' : "Zone Maintenance Stats",
433                                 'target': 'chart_server_zone_maint',
434                                 'style': 'barchart',
435                                 'data': [['Type','Counter'],<xsl:for-each select="server/counters[@type=&quot;zonestat&quot;]/counter[.&gt;0]">['<xsl:value-of select="@name"/>',<xsl:value-of select="."/>],</xsl:for-each>]
436                                 });
437             </script>
438             <!-- Non Mozilla specific markup -->
439             <div class="pie" id="chart_server_zone_maint">[no data to display]</div>
440           </xsl:if>
441           <table class="counters">
442             <xsl:for-each select="server/counters[@type=&quot;zonestat&quot;]/counter">
443               <xsl:sort select="." data-type="number" order="descending"/>
444               <xsl:variable name="css-class3">
445                 <xsl:choose>
446                   <xsl:when test="position() mod 2 = 0">even</xsl:when>
447                   <xsl:otherwise>odd</xsl:otherwise>
448                 </xsl:choose>
449               </xsl:variable>
450               <tr class="{$css-class3}">
451                 <th>
452                   <xsl:value-of select="@name"/>
453                 </th>
454                 <td>
455                   <xsl:value-of select="."/>
456                 </td>
457               </tr>
458             </xsl:for-each>
459           </table>
460         </xsl:if>
461         <xsl:if test="server/counters[@type=&quot;resstat&quot;]/counter[.&gt;0]">
462           <h2>Resolver Statistics (Common)</h2>
463           <table class="counters">
464             <xsl:for-each select="server/counters[@type=&quot;resstat&quot;]/counter">
465               <xsl:sort select="." data-type="number" order="descending"/>
466               <xsl:variable name="css-class4">
467                 <xsl:choose>
468                   <xsl:when test="position() mod 2 = 0">even</xsl:when>
469                   <xsl:otherwise>odd</xsl:otherwise>
470                 </xsl:choose>
471               </xsl:variable>
472               <tr class="{$css-class4}">
473                 <th>
474                   <xsl:value-of select="@name"/>
475                 </th>
476                 <td>
477                   <xsl:value-of select="."/>
478                 </td>
479               </tr>
480             </xsl:for-each>
481           </table>
482         </xsl:if>
483         <xsl:for-each select="views/view">
484           <xsl:if test="counters[@type=&quot;resstats&quot;]/counter[.&gt;0]">
485             <h3>Resolver Statistics for View <xsl:value-of select="@name"/></h3>
486             <table class="counters">
487               <xsl:for-each select="counters[@type=&quot;resstats&quot;]/counter[.&gt;0]">
488                 <xsl:sort select="." data-type="number" order="descending"/>
489                 <xsl:variable name="css-class5">
490                   <xsl:choose>
491                     <xsl:when test="position() mod 2 = 0">even</xsl:when>
492                     <xsl:otherwise>odd</xsl:otherwise>
493                   </xsl:choose>
494                 </xsl:variable>
495                 <tr class="{$css-class5}">
496                   <th>
497                     <xsl:value-of select="@name"/>
498                   </th>
499                   <td>
500                     <xsl:value-of select="."/>
501                   </td>
502                 </tr>
503               </xsl:for-each>
504             </table>
505           </xsl:if>
506         </xsl:for-each>
507
508         <xsl:for-each select="views/view">
509           <xsl:if test="cache/rrset">
510             <h3>Cache DB RRsets for View <xsl:value-of select="@name"/></h3>
511             <table class="counters">
512               <xsl:for-each select="cache/rrset">
513                 <xsl:variable name="css-class6">
514                   <xsl:choose>
515                     <xsl:when test="position() mod 2 = 0">even</xsl:when>
516                     <xsl:otherwise>odd</xsl:otherwise>
517                   </xsl:choose>
518                 </xsl:variable>
519                 <tr class="{$css-class6}">
520                   <th>
521                     <xsl:value-of select="name"/>
522                   </th>
523                   <td>
524                     <xsl:value-of select="counter"/>
525                   </td>
526                 </tr>
527               </xsl:for-each>
528             </table>
529             <br/>
530           </xsl:if>
531         </xsl:for-each>
532
533         <xsl:if test="server/counters[@type=&quot;sockstat&quot;]/counter[.&gt;0]">
534           <h2>Socket I/O Statistics</h2>
535           <table class="counters">
536             <xsl:for-each select="server/counters[@type=&quot;sockstat&quot;]/counter[.&gt;0]">
537               <xsl:variable name="css-class7">
538                 <xsl:choose>
539                   <xsl:when test="position() mod 2 = 0">even</xsl:when>
540                   <xsl:otherwise>odd</xsl:otherwise>
541                 </xsl:choose>
542               </xsl:variable>
543               <tr class="{$css-class7}">
544                 <th>
545                   <xsl:value-of select="@name"/>
546                 </th>
547                 <td>
548                   <xsl:value-of select="."/>
549                 </td>
550               </tr>
551             </xsl:for-each>
552           </table>
553           <br/>
554         </xsl:if>
555         <xsl:if test="views/view[zones/zone/counters[@type=&quot;rcode&quot;]/counter &gt;0]">
556           <h2>Response Codes per view/zone</h2>
557           <xsl:for-each select="views/view[zones/zone/counters[@type=&quot;rcode&quot;]/counter &gt;0]">
558             <h3>View <xsl:value-of select="@name"/></h3>
559             <xsl:variable name="thisview">
560               <xsl:value-of select="@name"/>
561             </xsl:variable>
562             <xsl:for-each select="zones/zone">
563               <xsl:if test="counters[@type=&quot;rcode&quot;]/counter[. &gt; 0]">
564                 <h4>Zone <xsl:value-of select="@name"/></h4>
565                 <xsl:if test="system-property('xsl:vendor')!='Transformiix'">
566                   <!-- Non Mozilla specific markup -->
567                 <script type="text/javascript">
568                         graphs.push({
569                                       'title': "Response Codes for zone <xsl:value-of select="@name"/>",
570                                       'target': 'chart_rescode_<xsl:value-of select="../../@name"/>_<xsl:value-of select="@name"/>',
571                                       'style': 'barchart',
572                                       'data': [['Type','Counter'],<xsl:for-each select="counters[@type=&quot;rcode&quot;]/counter[.&gt;0 and @name != &quot;QryAuthAns&quot;]">['<xsl:value-of select="@name"/>',<xsl:value-of select="."/>],</xsl:for-each>]
573                                       });
574
575                     </script>
576                 <xsl:variable name="target">
577                   <xsl:value-of select="@name"/>
578                 </xsl:variable>
579                   <div class="pie" id="chart_rescode_{$thisview}_{$target}">[no data to display]</div>
580                 </xsl:if>
581                 <table class="counters">
582                   <xsl:for-each select="counters[@type=&quot;rcode&quot;]/counter[.&gt;0 and @name != &quot;QryAuthAns&quot;]">
583                     <xsl:sort select="."/>
584                     <xsl:variable name="css-class10">
585                       <xsl:choose>
586                         <xsl:when test="position() mod 2 = 0">even</xsl:when>
587                         <xsl:otherwise>odd</xsl:otherwise>
588                       </xsl:choose>
589                     </xsl:variable>
590                     <tr class="{$css-class10}">
591                       <th>
592                         <xsl:value-of select="@name"/>
593                       </th>
594                       <td>
595                         <xsl:value-of select="."/>
596                       </td>
597                     </tr>
598                   </xsl:for-each>
599                 </table>
600               </xsl:if>
601             </xsl:for-each>
602           </xsl:for-each>
603         </xsl:if>
604         <xsl:if test="views/view[zones/zone/counters[@type=&quot;qtype&quot;]/counter &gt;0]">
605           <h2>Received QTYPES per view/zone</h2>
606           <xsl:for-each select="views/view[zones/zone/counters[@type=&quot;qtype&quot;]/counter &gt;0]">
607             <h3>View <xsl:value-of select="@name"/></h3>
608             <xsl:variable name="thisview2">
609               <xsl:value-of select="@name"/>
610             </xsl:variable>
611             <xsl:for-each select="zones/zone">
612               <xsl:if test="counters[@type=&quot;qtype&quot;]/counter[count(.) &gt; 0]">
613                 <h4>Zone <xsl:value-of select="@name"/></h4>
614                 <xsl:if test="system-property('xsl:vendor')!='Transformiix'">
615                   <!-- Non Mozilla specific markup -->
616                 <script type="text/javascript">
617                         graphs.push({
618                                       'title': "Query Types for zone <xsl:value-of select="@name"/>",
619                                       'target': 'chart_qtype_<xsl:value-of select="../../@name"/>_<xsl:value-of select="@name"/>',
620                                       'style': 'barchart',
621                                       'data': [['Type','Counter'],<xsl:for-each select="counters[@type=&quot;qtype&quot;]/counter[.&gt;0 and @name != &quot;QryAuthAns&quot;]">['<xsl:value-of select="@name"/>',<xsl:value-of select="."/>],</xsl:for-each>]
622                                       });
623
624                     </script>
625                 <xsl:variable name="target">
626                   <xsl:value-of select="@name"/>
627                 </xsl:variable>
628                   <div class="pie" id="chart_qtype_{$thisview2}_{$target}">[no data to display]</div>
629                 </xsl:if>
630                 <table class="counters">
631                   <xsl:for-each select="counters[@type=&quot;qtype&quot;]/counter">
632                     <xsl:sort select="."/>
633                     <xsl:variable name="css-class11">
634                       <xsl:choose>
635                         <xsl:when test="position() mod 2 = 0">even</xsl:when>
636                         <xsl:otherwise>odd</xsl:otherwise>
637                       </xsl:choose>
638                     </xsl:variable>
639                     <tr class="{$css-class11}">
640                       <th>
641                         <xsl:value-of select="@name"/>
642                       </th>
643                       <td>
644                         <xsl:value-of select="."/>
645                       </td>
646                     </tr>
647                   </xsl:for-each>
648                 </table>
649               </xsl:if>
650             </xsl:for-each>
651           </xsl:for-each>
652         </xsl:if>
653         <xsl:if test="socketmgr/sockets/socket">
654           <h2>Network Status</h2>
655           <table class="netstat">
656             <tr>
657               <th>ID</th>
658               <th>Name</th>
659               <th>Type</th>
660               <th>References</th>
661               <th>LocalAddress</th>
662               <th>PeerAddress</th>
663               <th>State</th>
664             </tr>
665             <xsl:for-each select="socketmgr/sockets/socket">
666               <xsl:sort select="id"/>
667               <xsl:variable name="css-class12">
668                 <xsl:choose>
669                   <xsl:when test="position() mod 2 = 0">even</xsl:when>
670                   <xsl:otherwise>odd</xsl:otherwise>
671                 </xsl:choose>
672               </xsl:variable>
673               <tr class="{$css-class12}">
674                 <td>
675                   <xsl:value-of select="id"/>
676                 </td>
677                 <td>
678                   <xsl:value-of select="name"/>
679                 </td>
680                 <td>
681                   <xsl:value-of select="type"/>
682                 </td>
683                 <td>
684                   <xsl:value-of select="references"/>
685                 </td>
686                 <td>
687                   <xsl:value-of select="local-address"/>
688                 </td>
689                 <td>
690                   <xsl:value-of select="peer-address"/>
691                 </td>
692                 <td>
693                   <xsl:for-each select="states">
694                     <xsl:value-of select="."/>
695                   </xsl:for-each>
696                 </td>
697               </tr>
698             </xsl:for-each>
699           </table>
700           <br/>
701         </xsl:if>
702         <xsl:if test="taskmgr/thread-model/type">
703           <h2>Task Manager Configuration</h2>
704           <table class="counters">
705             <tr>
706               <th class="even">Thread-Model</th>
707               <td>
708                 <xsl:value-of select="taskmgr/thread-model/type"/>
709               </td>
710             </tr>
711             <tr class="odd">
712               <th>Worker Threads</th>
713               <td>
714                 <xsl:value-of select="taskmgr/thread-model/worker-threads"/>
715               </td>
716             </tr>
717             <tr class="even">
718               <th>Default Quantum</th>
719               <td>
720                 <xsl:value-of select="taskmgr/thread-model/default-quantum"/>
721               </td>
722             </tr>
723             <tr class="odd">
724               <th>Tasks Running</th>
725               <td>
726                 <xsl:value-of select="taskmgr/thread-model/tasks-running"/>
727               </td>
728             </tr>
729           </table>
730           <br/>
731         </xsl:if>
732         <xsl:if test="taskmgr/tasks/task">
733           <h2>Tasks</h2>
734           <table class="tasks">
735             <tr>
736               <th>ID</th>
737               <th>Name</th>
738               <th>References</th>
739               <th>State</th>
740               <th>Quantum</th>
741             </tr>
742             <xsl:for-each select="taskmgr/tasks/task">
743               <xsl:sort select="name"/>
744               <xsl:variable name="css-class14">
745                 <xsl:choose>
746                   <xsl:when test="position() mod 2 = 0">even</xsl:when>
747                   <xsl:otherwise>odd</xsl:otherwise>
748                 </xsl:choose>
749               </xsl:variable>
750               <tr class="{$css-class14}">
751                 <td>
752                   <xsl:value-of select="id"/>
753                 </td>
754                 <td>
755                   <xsl:value-of select="name"/>
756                 </td>
757                 <td>
758                   <xsl:value-of select="references"/>
759                 </td>
760                 <td>
761                   <xsl:value-of select="state"/>
762                 </td>
763                 <td>
764                   <xsl:value-of select="quantum"/>
765                 </td>
766               </tr>
767             </xsl:for-each>
768           </table>
769           <br/>
770         </xsl:if>
771         <xsl:if test="memory/summary">
772           <h2>Memory Usage Summary</h2>
773           <table class="counters">
774             <xsl:for-each select="memory/summary/*">
775               <xsl:variable name="css-class13">
776                 <xsl:choose>
777                   <xsl:when test="position() mod 2 = 0">even</xsl:when>
778                   <xsl:otherwise>odd</xsl:otherwise>
779                 </xsl:choose>
780               </xsl:variable>
781               <tr class="{$css-class13}">
782                 <th>
783                   <xsl:value-of select="name()"/>
784                 </th>
785                 <td>
786                   <xsl:value-of select="."/>
787                 </td>
788               </tr>
789             </xsl:for-each>
790           </table>
791           <br/>
792         </xsl:if>
793         <xsl:if test="memory/contexts/context">
794           <h2>Memory Contexts</h2>
795           <table class="mctx">
796             <tr>
797               <th>ID</th>
798               <th>Name</th>
799               <th>References</th>
800               <th>TotalUse</th>
801               <th>InUse</th>
802               <th>MaxUse</th>
803               <th>BlockSize</th>
804               <th>Pools</th>
805               <th>HiWater</th>
806               <th>LoWater</th>
807             </tr>
808             <xsl:for-each select="memory/contexts/context">
809               <xsl:sort select="total" data-type="number" order="descending"/>
810               <xsl:variable name="css-class14">
811                 <xsl:choose>
812                   <xsl:when test="position() mod 2 = 0">even</xsl:when>
813                   <xsl:otherwise>odd</xsl:otherwise>
814                 </xsl:choose>
815               </xsl:variable>
816               <tr class="{$css-class14}">
817                 <td>
818                   <xsl:value-of select="id"/>
819                 </td>
820                 <td>
821                   <xsl:value-of select="name"/>
822                 </td>
823                 <td>
824                   <xsl:value-of select="references"/>
825                 </td>
826                 <td>
827                   <xsl:value-of select="total"/>
828                 </td>
829                 <td>
830                   <xsl:value-of select="inuse"/>
831                 </td>
832                 <td>
833                   <xsl:value-of select="maxinuse"/>
834                 </td>
835                 <td>
836                   <xsl:value-of select="blocksize"/>
837                 </td>
838                 <td>
839                   <xsl:value-of select="pools"/>
840                 </td>
841                 <td>
842                   <xsl:value-of select="hiwater"/>
843                 </td>
844                 <td>
845                   <xsl:value-of select="lowater"/>
846                 </td>
847               </tr>
848             </xsl:for-each>
849           </table>
850         </xsl:if>
851         <hr/>
852         <p class="footer">Internet Systems Consortium Inc.<br/><a href="http://www.isc.org">http://www.isc.org</a></p>
853       </body>
854     </html>
855   </xsl:template>
856 </xsl:stylesheet>