~vcs-imports/xena/trunk

« back to all changes in this revision

Viewing changes to ext/src/xalan-j_2_7_1/samples/translets/todo.xsl

  • Committer: matthewoliver
  • Date: 2009-12-10 03:18:07 UTC
  • Revision ID: vcs-imports@canonical.com-20091210031807-l086qguzdlljtkl9
Merged Xena Testing into Xena Stable for the Xena 5 release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0"?>
 
2
 
 
3
  <!--
 
4
   * Licensed to the Apache Software Foundation (ASF) under one
 
5
   * or more contributor license agreements. See the NOTICE file
 
6
   * distributed with this work for additional information
 
7
   * regarding copyright ownership. The ASF licenses this file
 
8
   * to you under the Apache License, Version 2.0 (the  "License");
 
9
   * you may not use this file except in compliance with the License.
 
10
   * You may obtain a copy of the License at
 
11
   *
 
12
   *     http://www.apache.org/licenses/LICENSE-2.0
 
13
   *
 
14
   * Unless required by applicable law or agreed to in writing, software
 
15
   * distributed under the License is distributed on an "AS IS" BASIS,
 
16
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
17
   * See the License for the specific language governing permissions and
 
18
   * limitations under the License.
 
19
  -->
 
20
 
 
21
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
 
22
<xsl:variable name="title" select="concat(todo/@project, ' ', todo/@major-version)"/>
 
23
  <xsl:template match="/">
 
24
    <HTML>
 
25
      <HEAD>
 
26
         <TITLE><xsl:value-of select="$title"/></TITLE>
 
27
      </HEAD>
 
28
      <BODY>
 
29
 
 
30
        <H2><xsl:value-of select="concat($title, ': ', todo/@title)"/></H2>
 
31
        <p><font size="-1">See a 
 
32
          <xsl:element name="a">
 
33
            <xsl:attribute name="href">#developer-list</xsl:attribute>
 
34
            <xsl:text>list of developers/initials.</xsl:text>
 
35
          </xsl:element>
 
36
        </font></p>
 
37
        <font size="-1"><p>Planned releases: 
 
38
            <BR/><xsl:for-each select="todo/actions/target-release-description">
 
39
              <xsl:element name="a">
 
40
                <xsl:attribute name="href">#release-date-<xsl:value-of select="date"/></xsl:attribute>
 
41
                <xsl:value-of select="date"/>
 
42
              </xsl:element><xsl:text> </xsl:text><xsl:text> </xsl:text>
 
43
            </xsl:for-each>
 
44
            <xsl:element name="a">
 
45
                <xsl:attribute name="href">#release-date-completed</xsl:attribute>
 
46
                <xsl:text>Completed</xsl:text>
 
47
              </xsl:element>
 
48
 
 
49
        </p></font>
 
50
        <xsl:for-each select="todo">
 
51
          <xsl:for-each select="actions">
 
52
              <xsl:for-each select="target-release-description">
 
53
                <p>
 
54
                  <xsl:apply-templates/>
 
55
                </p>
 
56
              </xsl:for-each>
 
57
              <xsl:for-each select="action">
 
58
                <xsl:if test="normalize-space(.)">
 
59
                  <p>
 
60
                   <xsl:number/>) <xsl:apply-templates/>
 
61
                   <xsl:if test="@*">
 
62
                    <BR/>
 
63
                   </xsl:if>
 
64
                   <xsl:apply-templates select="@*"/>
 
65
                  </p>
 
66
                </xsl:if>
 
67
            </xsl:for-each>
 
68
            <HR/>
 
69
          </xsl:for-each>
 
70
 
 
71
          <xsl:for-each select="completed">
 
72
              <xsl:element name="a">
 
73
                <xsl:attribute name="name">release-date-completed</xsl:attribute>
 
74
                <H3>Completed: </H3>
 
75
              </xsl:element>
 
76
            <xsl:for-each select="action">
 
77
              <xsl:if test="normalize-space(.)">
 
78
                <p>
 
79
                 <xsl:number/>) <xsl:apply-templates/>
 
80
                 <xsl:if test="@*">
 
81
                  <BR/>
 
82
                 </xsl:if>
 
83
                 <xsl:apply-templates select="@*"/>
 
84
                </p>
 
85
              </xsl:if>
 
86
          </xsl:for-each>
 
87
          <HR/>
 
88
        </xsl:for-each>
 
89
 
 
90
        <xsl:call-template name="developer-list"/>
 
91
       </xsl:for-each>
 
92
 
 
93
      </BODY>
 
94
    </HTML>
 
95
  </xsl:template>
 
96
 
 
97
  <xsl:template match="action/@*">
 
98
  <!-- Add link to the who attributes to corresponding item in developer-list -->
 
99
    <b><xsl:value-of select="name(.)"/>:</b><xsl:text> </xsl:text>
 
100
      <xsl:choose>
 
101
        <xsl:when test="name(.)='who'">
 
102
          <xsl:element name="a">
 
103
            <xsl:attribute name="href">#personref-<xsl:value-of select="."/></xsl:attribute>
 
104
            <xsl:value-of select="."/>
 
105
          </xsl:element>
 
106
        </xsl:when>
 
107
        <xsl:otherwise>
 
108
          <xsl:value-of select="."/>
 
109
        </xsl:otherwise>
 
110
      </xsl:choose>
 
111
    <xsl:if test="not (position()=last())">
 
112
      <xsl:text>, </xsl:text>
 
113
    </xsl:if>
 
114
  </xsl:template>
 
115
 
 
116
  <xsl:template match="target-release-description/date">
 
117
      <xsl:element name="a">
 
118
        <xsl:attribute name="name">release-date-<xsl:value-of select="."/></xsl:attribute>
 
119
        <b><xsl:text>For release: </xsl:text><xsl:value-of select="."/></b>
 
120
      </xsl:element>
 
121
    
 
122
  </xsl:template>
 
123
 
 
124
  <xsl:template match="issue">
 
125
    <BR/><b>Issue </b><xsl:text>[</xsl:text><xsl:value-of select="@id"/>
 
126
    <xsl:text>]: </xsl:text>
 
127
    <xsl:apply-templates/>
 
128
  </xsl:template>
 
129
 
 
130
  <xsl:template match="target-release-description/level">
 
131
    <xsl:text>, </xsl:text><xsl:apply-templates/>
 
132
  </xsl:template>
 
133
 
 
134
  <xsl:template match="target-release-description/goal">
 
135
    <BR/><b>Goal </b><xsl:text>[</xsl:text><xsl:value-of select="@type"/>
 
136
    <xsl:text>]: </xsl:text>
 
137
    <xsl:apply-templates/>
 
138
  </xsl:template>
 
139
 
 
140
 
 
141
  <xsl:template name="developer-list">
 
142
    <H3>
 
143
      <xsl:element name="a">
 
144
        <xsl:attribute name="name">developer-list</xsl:attribute>
 
145
        <xsl:text>Developers:</xsl:text>
 
146
      </xsl:element>
 
147
    </H3>
 
148
    <p>A list of some of the people currently working on <xsl:value-of select="/todo/@project"/>:</p>
 
149
    <ul>
 
150
    <xsl:for-each select="devs/person[not(@status = 'emeritus')]">
 
151
      <li>
 
152
        <xsl:apply-templates select="."/>
 
153
      </li>
 
154
    </xsl:for-each>
 
155
    </ul>
 
156
    <xsl:if test="boolean(devs/person[@status = 'emeritus'])">
 
157
      <p>And the Hall-of-Fame list of past developers:</p>
 
158
      <ul>
 
159
      <xsl:for-each select="devs/person[@status = 'emeritus']">
 
160
        <li>
 
161
          <xsl:apply-templates select="."/>
 
162
        </li>
 
163
      </xsl:for-each>
 
164
      </ul>
 
165
    </xsl:if>
 
166
  </xsl:template>
 
167
 
 
168
  <xsl:template match="person">
 
169
    <a href="mailto:{@email}">
 
170
      <xsl:value-of select="@name"/>
 
171
    </a>
 
172
    <xsl:element name="a">
 
173
      <xsl:attribute name="name"><xsl:text>personref-</xsl:text><xsl:value-of select="@id"/></xsl:attribute>
 
174
      <xsl:text> (</xsl:text><xsl:value-of select="@id"/><xsl:text>)</xsl:text>
 
175
    </xsl:element>
 
176
     <BR/><xsl:value-of select="."/>
 
177
  </xsl:template>
 
178
</xsl:stylesheet>