mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

andrug
22.06.2008 75ace4eb028a63acfc8d6933eaa4f209400ace8f
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
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:xlink="http://www.w3.org/1999/xlink"
                exclude-result-prefixes="xlink"           
                version="1.0">
  <xsl:output method="html"/>
 
  <!-- ================= root node ================ -->
  <xsl:template match="client">
    <html><body>
    <head>
      <link href="../result.css" rel="stylesheet" type="text/css"></link>
    </head>
      
    <h1>
      Details for client 
      <xsl:value-of select="@name" />
      ( id <xsl:value-of select="@id" /> )
    </h1>
    <p>
      <xsl:apply-templates select="instance"/>
      <xsl:apply-templates select="operation"/>
      <xsl:apply-templates select="message"/>
      <xsl:apply-templates select="operationResult"/>
    </p>
    </body>
    </html>
  </xsl:template>
 
  <!-- ============= instance node =============== -->
  <xsl:template match="instance">
    <xsl:variable name="iName" select="normalize-space(@name)"/>
    <ul><li>
      Instance <font color="blue"><b><xsl:value-of select="$iName"/></b></font>
      <xsl:apply-templates select="step"/>
      <xsl:apply-templates select="operation"/>
    </li></ul>
    <xsl:apply-templates select="message"/>
  </xsl:template>
 
  <!-- ============= step node =============== -->
  <xsl:template match="step">
    <xsl:variable name="sName" select="normalize-space(@name)"/>
    <ul><li>
      Step <b><xsl:value-of select="$sName"/></b><br/>
      <xsl:apply-templates select="message"/>
      <xsl:apply-templates select="operation"/>
    </li></ul>
  </xsl:template>
 
  <!-- ============= operation node =============== -->
  <xsl:template match="operation">
    <xsl:variable name="opName" select="normalize-space(@name)"/>
    <xsl:variable name="opDate" select="normalize-space(@date)"/>
    <ul>
    <li>
      <b><xsl:value-of select="$opName"/></b>
         <i>@ <xsl:value-of select="$opDate"/></i><br/>
      <xsl:apply-templates select="message"/>
      <xsl:apply-templates select="operation"/>
      <xsl:apply-templates select="operationResult"/>
    </li>
    </ul>
  </xsl:template>
 
 
  <!-- ============= message node =============== -->
  <xsl:template match="message">
    <xsl:choose>
      <xsl:when test="@xlink:href">
        <a href="{@xlink:href}"><xsl:value-of select="." /></a>
      </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="." />
        </xsl:otherwise>
      </xsl:choose>
     <br/>
  </xsl:template>
 
  <!-- ============= operationResult node =============== -->
  <xsl:template match="operationResult">
    <xsl:variable name="rc" select="normalize-space(@returncode)"/>
    <xsl:variable name="exprc" select="normalize-space(@expected)"/>
    <xsl:variable name="result" select="normalize-space(.)"/>
    <xsl:variable name="status" select="normalize-space(@status)"/>
    
    <b>
      <xsl:choose>
        <xsl:when test="$status='SUCCESS'">
          <span class="pass"><xsl:value-of select="$status"/></span>
          [
           return code <xsl:value-of select="$rc" />,
           expected <xsl:value-of select="$exprc" />
          ] <br/>
        </xsl:when>
        <xsl:when test="$status='ERROR'">
          <span class="fail"><xsl:value-of select="$status"/></span>
          [
           return code <xsl:value-of select="$rc" />,
           expected <xsl:value-of select="$exprc" />,
           <xsl:value-of select="$result" /> 
          ] <br/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="$status"/>
        </xsl:otherwise>
      </xsl:choose>
    </b>
  </xsl:template>
 
 
  </xsl:stylesheet>