annotate bug-list.xsl @ 9:cc7244ab1b9f

implemented time reports on bugs
author cin
date Sat, 05 Sep 2015 22:01:12 +0300
parents 2a5f38eb25a9
children 14a966369278
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
1 <?xml version="1.0" encoding="UTF-8"?>
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
2 <xsl:stylesheet version="1.0"
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common"
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
4 extension-element-prefixes="exsl">
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
5 <xsl:output method="text" indent="yes" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
6
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
7 <!-- PARAMETERS -->
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
8
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
9 <!-- chargeset - название аккаунта, на который вести расходы -->
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
10 <xsl:param name="chargeset" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
11
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
12 <!-- root_task_id - id корневой задачи, в которую будут организованы все
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
13 задачи -->
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
14 <xsl:param name="root_task_id" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
15
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
16 <!-- root_task - описание корневой задачи -->
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
17 <xsl:param name="root_task" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
18
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
19 <!-- GLOBAL VARIABLES -->
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
20 <xsl:variable name="resources"
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
21 select="document('resources.xml')/resources/resource" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
22
3
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
23 <xsl:variable name="bugs" select="/bugzilla/bug" />
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
24
3
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
25 <xsl:key name="bugid" match="/bugzilla/bug" use="string(bug_id)" />
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
26
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
27 <xsl:variable name="roots" select="$bugs[not(blocked[key('bugid',.)])]" />
1
d1400de5832b improved xsl
cin
parents: 0
diff changeset
28
d1400de5832b improved xsl
cin
parents: 0
diff changeset
29 <!-- BUILD BUG TREE -->
d1400de5832b improved xsl
cin
parents: 0
diff changeset
30 <xsl:variable name="tree">
d1400de5832b improved xsl
cin
parents: 0
diff changeset
31 <xsl:apply-templates mode="tree" select="$roots" />
d1400de5832b improved xsl
cin
parents: 0
diff changeset
32 </xsl:variable>
d1400de5832b improved xsl
cin
parents: 0
diff changeset
33
d1400de5832b improved xsl
cin
parents: 0
diff changeset
34 <xsl:template match="bug" mode="tree">
d1400de5832b improved xsl
cin
parents: 0
diff changeset
35 <xsl:element name="bug">
d1400de5832b improved xsl
cin
parents: 0
diff changeset
36 <xsl:attribute name="id"><xsl:value-of select="bug_id" /></xsl:attribute>
3
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
37 <xsl:if test="component = 'product' or not(number(estimated_time))">
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
38 <xsl:attribute name="group"><xsl:value-of select="boolean(1)" /></xsl:attribute>
1
d1400de5832b improved xsl
cin
parents: 0
diff changeset
39 </xsl:if>
d1400de5832b improved xsl
cin
parents: 0
diff changeset
40 <xsl:for-each select="dependson">
d1400de5832b improved xsl
cin
parents: 0
diff changeset
41 <xsl:apply-templates mode="tree" select="key('bugid', .)" />
d1400de5832b improved xsl
cin
parents: 0
diff changeset
42 </xsl:for-each>
d1400de5832b improved xsl
cin
parents: 0
diff changeset
43 </xsl:element>
d1400de5832b improved xsl
cin
parents: 0
diff changeset
44 </xsl:template>
d1400de5832b improved xsl
cin
parents: 0
diff changeset
45
d1400de5832b improved xsl
cin
parents: 0
diff changeset
46 <!-- CALCULATE RELATIONS -->
d1400de5832b improved xsl
cin
parents: 0
diff changeset
47 <xsl:variable name="relations">
3
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
48 <xsl:apply-templates select="$bugs" mode="relations" />
1
d1400de5832b improved xsl
cin
parents: 0
diff changeset
49 </xsl:variable>
d1400de5832b improved xsl
cin
parents: 0
diff changeset
50
d1400de5832b improved xsl
cin
parents: 0
diff changeset
51 <xsl:template match="bug" mode="relations">
d1400de5832b improved xsl
cin
parents: 0
diff changeset
52 <xsl:variable name="bugid" select="string(bug_id)" />
d1400de5832b improved xsl
cin
parents: 0
diff changeset
53 <bug id="{$bugid}">
6
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
54 <!-- calculate all palaces where the same node appears -->
1
d1400de5832b improved xsl
cin
parents: 0
diff changeset
55 <xsl:apply-templates select="exsl:node-set($tree)//bug[@id = $bugid]"
d1400de5832b improved xsl
cin
parents: 0
diff changeset
56 mode="traverse-relations">
d1400de5832b improved xsl
cin
parents: 0
diff changeset
57 </xsl:apply-templates>
d1400de5832b improved xsl
cin
parents: 0
diff changeset
58 </bug>
d1400de5832b improved xsl
cin
parents: 0
diff changeset
59 </xsl:template>
d1400de5832b improved xsl
cin
parents: 0
diff changeset
60
d1400de5832b improved xsl
cin
parents: 0
diff changeset
61 <xsl:template match="bug" mode="traverse-relations">
d1400de5832b improved xsl
cin
parents: 0
diff changeset
62 <xsl:variable name="bugid" select="@id" />
3
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
63 <xsl:variable name="path" select="ancestor::bug" />
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
64 <xsl:variable name="level" select="count($path)" />
6
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
65 <!-- for the specified path calculate the distances to the preceding container -->
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
66 <xsl:for-each select="$path[@group]">
3
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
67 <xsl:variable name="pos" select="position()" />
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
68 <xsl:variable name="rank" select="$level - $pos" />
3
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
69 <rel container="{@id}" rank="{$rank}" level="{$level}">
6
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
70 <!-- record the full path -->
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
71 <xsl:for-each select="$path[@group]">
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
72 <parent id="{@id}" bugid="{$bugid}" />
3
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
73 </xsl:for-each>
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
74 </rel>
1
d1400de5832b improved xsl
cin
parents: 0
diff changeset
75 </xsl:for-each>
d1400de5832b improved xsl
cin
parents: 0
diff changeset
76 </xsl:template>
d1400de5832b improved xsl
cin
parents: 0
diff changeset
77
d1400de5832b improved xsl
cin
parents: 0
diff changeset
78 <!-- CALCULATE STRUCTURE -->
d1400de5832b improved xsl
cin
parents: 0
diff changeset
79
3
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
80 <xsl:variable name="parents">
1
d1400de5832b improved xsl
cin
parents: 0
diff changeset
81 <xsl:apply-templates select="exsl:node-set($relations)"
3
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
82 mode="parents" />
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
83 </xsl:variable>
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
84
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
85 <xsl:template match="bug" mode="parents">
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
86 <xsl:variable name="parent"
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
87 select="rel[ not(../rel/@rank &lt; @rank) ][1]" />
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
88 <bug id="{@id}" parent="{$parent/@container}" rank="{$parent/@rank}"
6
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
89 level="{$parent/@level}">
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
90 <xsl:copy-of select="$parent/node()" />
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
91 </bug>
3
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
92 </xsl:template>
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
93
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
94 <xsl:variable name="structure">
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
95 <xsl:choose>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
96 <xsl:when test="$root_task">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
97 <bug id="_root" desc="{$root_task}" group="true">
6
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
98 <xsl:apply-templates select="$roots" mode="structure" />
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
99 </bug>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
100 </xsl:when>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
101 <xsl:otherwise>
6
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
102 <xsl:apply-templates select="$roots" mode="structure" />
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
103 </xsl:otherwise>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
104 </xsl:choose>
1
d1400de5832b improved xsl
cin
parents: 0
diff changeset
105 </xsl:variable>
d1400de5832b improved xsl
cin
parents: 0
diff changeset
106
6
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
107 <!-- applied in context of the bugzilla document -->
1
d1400de5832b improved xsl
cin
parents: 0
diff changeset
108 <xsl:template match="bug" mode="structure">
3
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
109 <xsl:variable name="id" select="string(bug_id)" />
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
110 <xsl:variable name="self" select="." />
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
111 <xsl:variable name="children"
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
112 select="exsl:node-set($parents)/bug[@parent = $id]" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
113 <xsl:element name="bug">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
114 <xsl:attribute name="id"><xsl:value-of select="$id" /></xsl:attribute>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
115 <xsl:attribute name="desc"><xsl:value-of select="short_desc" /></xsl:attribute>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
116
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
117 <xsl:if test="$children">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
118 <xsl:attribute name="group"><xsl:value-of select="boolean($children)" /></xsl:attribute>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
119
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
120 <xsl:for-each select="$children">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
121 <xsl:variable name="child" select="@id" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
122 <xsl:apply-templates select="$bugs[bug_id = $child]"
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
123 mode="structure" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
124 </xsl:for-each>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
125
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
126 </xsl:if>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
127
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
128 <!-- filter out dependencies -->
6
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
129 <!-- exclude children, and missing bugs -->
3
36ae3ec94442 xslt: prepare taskjuggler tasks structure
cin
parents: 1
diff changeset
130 <xsl:variable name="dependencies"
6
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
131 select="dependson[not(text() = exsl:node-set($parents)/bug/parent[@id=$id]/@bugid)][key('bugid', .)]" />
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
132 <xsl:for-each select="$dependencies">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
133 <dependency id="{.}" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
134 </xsl:for-each>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
135 </xsl:element>
1
d1400de5832b improved xsl
cin
parents: 0
diff changeset
136 </xsl:template>
d1400de5832b improved xsl
cin
parents: 0
diff changeset
137
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
138 <!-- output -->
0
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
139 <xsl:template match="/">
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
140 <xsl:apply-templates select="exsl:node-set($structure)/bug">
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
141 <xsl:with-param name="indent" select="0" />
6
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
142 <xsl:with-param name="chargeset" select="$chargeset" />
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
143 </xsl:apply-templates>
0
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
144 </xsl:template>
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
145
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
146 <xsl:template match="bug">
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
147 <xsl:param name="indent" select="0" />
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
148 <xsl:param name="chargeset" />
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
149 <xsl:variable name="id" select="@id" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
150 <xsl:variable name="details" select="$bugs[bug_id = $id]" />
6
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
151 <xsl:variable name="hasTime"
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
152 select="number($details/estimated_time) or number($details/actual_time) or number($details/remaining_time)" />
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
153
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
154 <!-- task header -->
0
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
155 <xsl:call-template name="start-task">
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
156 <xsl:with-param name="indent" select="$indent" />
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
157 <xsl:with-param name="id">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
158 <xsl:call-template name="bug-local-name">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
159 <xsl:with-param name="id" select="@id" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
160 </xsl:call-template>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
161 </xsl:with-param>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
162 <xsl:with-param name="desc" select="@desc" />
0
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
163 </xsl:call-template>
6
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
164
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
165 <xsl:if test="$chargeset">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
166 <xsl:call-template name="println">
6
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
167 <xsl:with-param name="indent" select="$indent + 1" />
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
168 <xsl:with-param name="text"
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
169 select="concat('chargeset ', $chargeset)" />
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
170 </xsl:call-template>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
171 </xsl:if>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
172
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
173 <!-- task details -->
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
174 <xsl:choose>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
175 <xsl:when test="@group">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
176 <!-- DEBUG -->
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
177 <xsl:call-template name="comment">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
178 <xsl:with-param name="indent" select="$indent + 1" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
179 <xsl:with-param name="comment" select="'group'" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
180 </xsl:call-template>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
181
0
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
182
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
183 <xsl:apply-templates select="$details/node()"
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
184 mode="group-details">
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
185 <xsl:with-param name="indent" select="$indent + 1" />
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
186 </xsl:apply-templates>
0
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
187
6
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
188 <xsl:if test="$hasTime">
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
189 <xsl:call-template name="start-task">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
190 <xsl:with-param name="indent" select="$indent + 1" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
191 <xsl:with-param name="id" select="'manage'" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
192 <xsl:with-param name="desc" select="@desc" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
193 </xsl:call-template>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
194 <xsl:apply-templates
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
195 select="$details/estimated_time | $details/actual_time | $details/remaining_time | $details/assigned_to"
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
196 mode="task-details">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
197 <xsl:with-param name="indent" select="$indent + 2" />
6
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
198 <xsl:with-param name="hasTime" select="$hasTime" />
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
199 </xsl:apply-templates>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
200 <xsl:call-template name="end-task">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
201 <xsl:with-param name="indent" select="$indent + 1" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
202 </xsl:call-template>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
203 </xsl:if>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
204 </xsl:when>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
205 <xsl:otherwise>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
206 <xsl:apply-templates select="$details/node()"
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
207 mode="task-details">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
208 <xsl:with-param name="indent" select="$indent + 1" />
6
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
209 <xsl:with-param name="hasTime" select="$hasTime" />
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
210 </xsl:apply-templates>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
211 </xsl:otherwise>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
212 </xsl:choose>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
213
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
214 <!-- subtasks and dependencies -->
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
215 <xsl:apply-templates>
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
216 <xsl:with-param name="indent" select="$indent + 1" />
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
217 <xsl:with-param name="referer" select="." />
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
218 </xsl:apply-templates>
0
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
219
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
220 <xsl:call-template name="end-task">
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
221 <xsl:with-param name="indent" select="$indent" />
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
222 </xsl:call-template>
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
223 </xsl:template>
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
224
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
225 <xsl:template match="dependency">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
226 <xsl:param name="indent" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
227 <xsl:param name="referer" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
228 <xsl:call-template name="println">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
229 <xsl:with-param name="indent" select="$indent" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
230 <xsl:with-param name="text">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
231 <xsl:text>depends </xsl:text>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
232 <xsl:call-template name="bug-reference">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
233 <xsl:with-param name="id" select="@id" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
234 <xsl:with-param name="referer" select="$referer" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
235 </xsl:call-template>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
236 </xsl:with-param>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
237 </xsl:call-template>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
238 </xsl:template>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
239
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
240
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
241 <xsl:template match="text()" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
242
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
243 <!-- TASK ATTRIBUTES -->
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
244
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
245 <xsl:template match="estimated_time" mode="task-details">
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
246 <xsl:param name="indent" />
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
247 <xsl:if test="number(.)">
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
248 <xsl:call-template name="println">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
249 <xsl:with-param name="indent" select="$indent" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
250 <xsl:with-param name="text" select="concat('effort ', .,'h')" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
251 </xsl:call-template>
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
252 </xsl:if>
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
253 </xsl:template>
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
254
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
255 <xsl:template match="assigned_to" mode="task-details">
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
256 <xsl:param name="indent" />
6
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
257 <xsl:param name="hasTime" />
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
258 <xsl:if test="$hasTime">
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
259 <xsl:variable name="email" select="string(.)" />
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
260 <xsl:variable name="resource" select="$resources[@email = $email]/@id" />
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
261 <xsl:if test="$resource">
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
262 <xsl:call-template name="println">
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
263 <xsl:with-param name="indent" select="$indent" />
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
264 <xsl:with-param name="text"
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
265 select="concat('allocate ', $resource)" />
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
266 </xsl:call-template>
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
267 </xsl:if>
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
268 </xsl:if>
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
269 </xsl:template>
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
270 <xsl:template match="text()" mode="task-details">
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
271 </xsl:template>
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
272
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
273 <xsl:template match="assigned_to" mode="group-details">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
274 <xsl:param name="indent" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
275 <xsl:variable name="email" select="string(.)" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
276 <xsl:variable name="resource" select="$resources[@email = $email]/@id" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
277 <xsl:if test="$resource">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
278 <xsl:call-template name="println">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
279 <xsl:with-param name="indent" select="$indent" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
280 <xsl:with-param name="text"
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
281 select="concat('responsible ', $resource)" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
282 </xsl:call-template>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
283 </xsl:if>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
284 </xsl:template>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
285 <xsl:template match="text()" mode="group-details">
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
286 </xsl:template>
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
287
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
288 <!-- PRIMITIVES -->
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
289
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
290
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
291
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
292 <xsl:template name="bug-local-name">
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
293 <xsl:param name="id" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
294 <xsl:value-of select="concat('bug',$id)" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
295 </xsl:template>
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
296
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
297
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
298 <xsl:template name="bug-reference">
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
299 <xsl:param name="id" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
300 <xsl:param name="referer" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
301
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
302 <xsl:variable name="refererPathFragment">
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
303 <bug id="#root" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
304 <xsl:for-each select="$referer/ancestor-or-self::bug">
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
305 <bug id="{@id}" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
306 </xsl:for-each>
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
307 </xsl:variable>
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
308 <xsl:variable name="targetPathFragment">
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
309 <bug id="#root" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
310 <xsl:for-each
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
311 select="exsl:node-set($structure)//bug[@id = $id]/ancestor-or-self::bug">
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
312 <bug id="{@id}" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
313 </xsl:for-each>
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
314 </xsl:variable>
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
315 <xsl:variable name="path"
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
316 select="exsl:node-set($refererPathFragment)/bug" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
317 <xsl:variable name="targetPath"
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
318 select="exsl:node-set($targetPathFragment)/bug" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
319
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
320 <!-- find closest shared container id -->
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
321 <xsl:variable name="join"
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
322 select="($path[@id = $targetPath/@id])[position() = last() ]/@id" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
323
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
324 <!-- how many levels we need to up -->
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
325 <xsl:variable name="depth"
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
326 select="count($path[@id = $join]/following-sibling::node())" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
327
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
328 <!-- DEBUG -->
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
329 <!-- <xsl:value-of select="concat('id=', $id, ',referer=', $referer/@id)"
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
330 /> <xsl:text>, path=</xsl:text> <xsl:for-each select="$targetPath"> <xsl:value-of
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
331 select="concat(name(),@id)" /> <xsl:if test="position() != last()"> <xsl:text>-</xsl:text>
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
332 </xsl:if> </xsl:for-each> -->
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
333 <!-- DEBUG -->
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
334 <!-- <xsl:value-of select="concat(', join=', $join,', depth=', $depth,'
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
335 ')" /> -->
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
336
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
337 <!-- PRINT REFERENCE -->
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
338 <xsl:call-template name="repeat">
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
339 <xsl:with-param name="value" select="'!'" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
340 <xsl:with-param name="count" select="$depth" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
341 </xsl:call-template>
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
342 <xsl:for-each select="$targetPath[@id = $join]/following-sibling::node()">
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
343 <xsl:call-template name="bug-local-name">
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
344 <xsl:with-param name="id" select="@id" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
345 </xsl:call-template>
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
346 <xsl:if test="position() != last()">
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
347 <xsl:text>.</xsl:text>
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
348 </xsl:if>
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
349 </xsl:for-each>
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
350
0
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
351 </xsl:template>
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
352
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
353 <xsl:template name="start-task">
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
354 <xsl:param name="indent" />
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
355 <xsl:param name="id" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
356 <xsl:param name="desc" />
0
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
357 <xsl:call-template name="begin-line">
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
358 <xsl:with-param name="indent" select="$indent" />
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
359 </xsl:call-template>
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
360 <xsl:text>task </xsl:text>
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
361 <xsl:value-of select="$id" />
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
362 <xsl:value-of select="concat(' &quot;',$desc,'&quot; {')" />
0
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
363 <xsl:call-template name="end-line" />
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
364 </xsl:template>
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
365
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
366 <xsl:template name="end-task">
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
367 <xsl:param name="indent" />
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
368 <xsl:call-template name="begin-line">
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
369 <xsl:with-param name="indent" select="$indent" />
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
370 </xsl:call-template>
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
371 <xsl:text>}</xsl:text>
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
372 <xsl:call-template name="end-line" />
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
373 </xsl:template>
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
374
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
375 <xsl:template name="begin-line">
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
376 <xsl:param name="indent" />
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
377 <xsl:if test="number($indent) > 0">
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
378 <xsl:text> </xsl:text>
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
379 <xsl:call-template name="begin-line">
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
380 <xsl:with-param name="indent" select="$indent - 1" />
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
381 </xsl:call-template>
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
382 </xsl:if>
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
383 </xsl:template>
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
384
0
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
385 <xsl:template name="end-line">
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
386 <xsl:text>&#xa;</xsl:text>
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
387 </xsl:template>
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
388
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
389 <xsl:template name="repeat">
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
390 <xsl:param name="value" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
391 <xsl:param name="count" select="0" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
392
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
393 <xsl:if test="number($count)">
6
2a5f38eb25a9 migrated to saxon8 as xslt processor
cin
parents: 5
diff changeset
394 <xsl:value-of select="$value" />
4
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
395 <xsl:call-template name="repeat">
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
396 <xsl:with-param name="value" select="$value" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
397 <xsl:with-param name="count" select="$count - 1" />
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
398 </xsl:call-template>
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
399 </xsl:if>
f8f966388b68 xslt: bugzilla -> taskjuggler
cin
parents: 3
diff changeset
400 </xsl:template>
5
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
401
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
402 <xsl:template name="comment">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
403 <xsl:param name="indent" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
404 <xsl:param name="comment" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
405 <xsl:call-template name="println">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
406 <xsl:with-param name="indent" select="$indent" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
407 <xsl:with-param name="text">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
408 <xsl:text># </xsl:text>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
409 <xsl:value-of select="$comment" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
410 </xsl:with-param>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
411 </xsl:call-template>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
412 </xsl:template>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
413
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
414 <xsl:template name="println">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
415 <xsl:param name="indent" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
416 <xsl:param name="text" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
417 <xsl:call-template name="begin-line">
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
418 <xsl:with-param name="indent" select="$indent" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
419 </xsl:call-template>
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
420 <xsl:value-of select="$text" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
421 <xsl:call-template name="end-line" />
d2efec56373f working buglist transform and bugs fetching
cin
parents: 4
diff changeset
422 </xsl:template>
0
8cae44c166d3 initial xslt and sample xml
cin
parents:
diff changeset
423 </xsl:stylesheet>