|
Added
Link Here
|
| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<!-- |
| 3 |
/******************************************************************************* |
| 4 |
* Copyright (c) 2008 Standards for Technology in Automotive Retail and others |
| 5 |
* All rights reserved. This program and the accompanying materials |
| 6 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 7 |
* which accompanies this distribution, and is available at |
| 8 |
* http://www.eclipse.org/legal/epl-v10.html |
| 9 |
* |
| 10 |
* Contributors: |
| 11 |
* David Carver (STAR) - bug 243303 - initial API and implementation |
| 12 |
*******************************************************************************/ |
| 13 |
--> |
| 14 |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
| 15 |
xmlns:plan="http://www.eclipse.org/project/plan" |
| 16 |
xmlns:html="http://www.w3.org/1999/xhtml" |
| 17 |
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
| 18 |
xmlns:bz="http://www.bugzilla.org/rdf#" |
| 19 |
xmlns:nc="http://home.netscape.com/NC-rdf#" |
| 20 |
xmlns="http://www.w3.org/1999/xhtml" |
| 21 |
exclude-result-prefixes="html plan rdf bz nc" > |
| 22 |
<xsl:output method="xml" indent="yes" encoding="UTF-8"/> |
| 23 |
<xsl:param name="projectName"> |
| 24 |
<xsl:text>Project Name Here</xsl:text> |
| 25 |
</xsl:param> |
| 26 |
<xsl:param name="projectId" select="/plan:plan/plan:release/@projectid"/> |
| 27 |
|
| 28 |
<xsl:include href="project-plan-bugzilla.xsl"/> |
| 29 |
<xsl:include href="url-encode.xsl"/> |
| 30 |
|
| 31 |
<xsl:template match="/plan:plan"> |
| 32 |
<html> |
| 33 |
<body> |
| 34 |
<xsl:apply-templates select="." mode="plan"/> |
| 35 |
</body> |
| 36 |
</html> |
| 37 |
</xsl:template> |
| 38 |
|
| 39 |
<!-- Start processing the Project Plan --> |
| 40 |
<xsl:template match="plan:plan" mode="plan"> |
| 41 |
<div id="maincontent"> |
| 42 |
<div id="midcolumn"> |
| 43 |
<h1> |
| 44 |
<span style="font-size: 140%">Project Plan For |
| 45 |
<a href="http://www.eclipse.org/projects/project_summary.php?projectid={$projectId}"> |
| 46 |
<xsl:value-of select="$projectName"/> |
| 47 |
</a> |
| 48 |
</span> |
| 49 |
<xsl:text>, version </xsl:text> |
| 50 |
<xsl:value-of select="plan:release/@version"/> |
| 51 |
</h1> |
| 52 |
<xsl:apply-templates select="plan:*"/> |
| 53 |
</div> |
| 54 |
</div> |
| 55 |
</xsl:template> |
| 56 |
|
| 57 |
<xsl:template match="plan:introduction"> |
| 58 |
<h2>Introduction</h2> |
| 59 |
<xsl:call-template name="copyNodeorCData"> |
| 60 |
<xsl:with-param name="node" select="."/> |
| 61 |
</xsl:call-template> |
| 62 |
</xsl:template> |
| 63 |
|
| 64 |
<xsl:template match="plan:release_deliverables"> |
| 65 |
<h2>Release Deliverables</h2> |
| 66 |
<xsl:call-template name="copyNodeorCData"> |
| 67 |
<xsl:with-param name="node" select="."/> |
| 68 |
</xsl:call-template> |
| 69 |
</xsl:template> |
| 70 |
|
| 71 |
<xsl:template match="plan:release_milestones"> |
| 72 |
<h2>Release Milestones</h2> |
| 73 |
<xsl:apply-templates select="plan:preamble"/> |
| 74 |
<table border="1" align="center"> |
| 75 |
<xsl:apply-templates select="plan:milestone"/> |
| 76 |
</table> |
| 77 |
<xsl:apply-templates select="plan:postamble"/> |
| 78 |
</xsl:template> |
| 79 |
|
| 80 |
<xsl:template match="plan:milestone"> |
| 81 |
<tr> |
| 82 |
<td> |
| 83 |
<b> |
| 84 |
<xsl:value-of select="@milestone"/> |
| 85 |
</b> |
| 86 |
</td> |
| 87 |
<td> |
| 88 |
<xsl:value-of select="@date"/> |
| 89 |
</td> |
| 90 |
<td> |
| 91 |
<xsl:call-template name="copyNodeorCData"> |
| 92 |
<xsl:with-param name="node" select="."/> |
| 93 |
</xsl:call-template> |
| 94 |
</td> |
| 95 |
</tr> |
| 96 |
</xsl:template> |
| 97 |
|
| 98 |
<xsl:template match="plan:preamble | plan:postamble"> |
| 99 |
<xsl:call-template name="copyNodeorCData"> |
| 100 |
<xsl:with-param name="node" select="."/> |
| 101 |
</xsl:call-template> |
| 102 |
</xsl:template> |
| 103 |
|
| 104 |
<xsl:template match="plan:target_environments"> |
| 105 |
<h2>Target Environments</h2> |
| 106 |
<xsl:call-template name="copyNodeorCData"> |
| 107 |
<xsl:with-param name="node" select="."/> |
| 108 |
</xsl:call-template> |
| 109 |
<xsl:if test="plan:internationalization"> |
| 110 |
<h3>Internationalization</h3> |
| 111 |
<xsl:apply-templates select="plan:internationalization"/> |
| 112 |
</xsl:if> |
| 113 |
</xsl:template> |
| 114 |
|
| 115 |
<xsl:template match="themes_and_priorities"> |
| 116 |
<h2>Themese and Priorities</h2> |
| 117 |
<xsl:apply-templates/> |
| 118 |
</xsl:template> |
| 119 |
|
| 120 |
<xsl:template match="themes"> |
| 121 |
<h3><xsl:value-of select="@name"/></h3> |
| 122 |
<xsl:if test="description"> |
| 123 |
<xsl:apply-templates select="plan:description"/> |
| 124 |
</xsl:if> |
| 125 |
<xsl:if test="committed"> |
| 126 |
<ul> |
| 127 |
<xsl:apply-templates select="plan:committed"/> |
| 128 |
</ul> |
| 129 |
</xsl:if> |
| 130 |
<xsl:if test="proposed"> |
| 131 |
<ul> |
| 132 |
<xsl:apply-templates select="plan:proposed"/> |
| 133 |
</ul> |
| 134 |
</xsl:if> |
| 135 |
<xsl:if test="deferred"> |
| 136 |
<ul> |
| 137 |
<xsl:apply-templates select="plan:deferred"/> |
| 138 |
</ul> |
| 139 |
</xsl:if> |
| 140 |
|
| 141 |
</xsl:template> |
| 142 |
|
| 143 |
<xsl:template match="plan:description"> |
| 144 |
<xsl:call-template name="copyNodeorCData"> |
| 145 |
<xsl:with-param name="node" select="."/> |
| 146 |
</xsl:call-template> |
| 147 |
</xsl:template> |
| 148 |
|
| 149 |
<xsl:template match="plan:committed"> |
| 150 |
<xsl:call-template name="ThemeBugzilla"> |
| 151 |
<xsl:with-param name="node" select="."/> |
| 152 |
<xsl:with-param name="section">Committed</xsl:with-param> |
| 153 |
</xsl:call-template> |
| 154 |
</xsl:template> |
| 155 |
|
| 156 |
<xsl:template match="@bugzilla"> |
| 157 |
<xsl:variable name="url">https://bugs.eclipse.org/</xsl:variable> |
| 158 |
<xsl:variable name="rdf"><xsl:text>&ctype=rdf&columnlist=bug_id,short_desc,target_milestone,bug_status</xsl:text></xsl:variable> |
| 159 |
<xsl:variable name="actualurl"> |
| 160 |
<xsl:value-of select="normalize-space(.)"/> |
| 161 |
</xsl:variable> |
| 162 |
<xsl:variable name="test"> |
| 163 |
<xsl:value-of select="substring($actualurl, 1, 25)"/> |
| 164 |
</xsl:variable> |
| 165 |
|
| 166 |
<xsl:variable name="bugzillaURL"> |
| 167 |
<xsl:choose> |
| 168 |
<xsl:when test="substring($actualurl, 1, 25) = 'https://bugs.eclipse.org/'"> |
| 169 |
<xsl:value-of select="$url"/> |
| 170 |
<xsl:call-template name="url-encode"> |
| 171 |
<xsl:with-param name="str" select="substring($actualurl,26)"/> |
| 172 |
</xsl:call-template> |
| 173 |
<xsl:value-of select="$rdf"/> |
| 174 |
</xsl:when> |
| 175 |
<xsl:when test="substring($actualurl, 1, 24) = 'http://bugs.eclipse.org/'"> |
| 176 |
<xsl:value-of select="$url"/> |
| 177 |
<xsl:call-template name="url-encode"> |
| 178 |
<xsl:with-param name="str" select="substring($actualurl,25)"/> |
| 179 |
</xsl:call-template> |
| 180 |
<xsl:value-of select="$rdf"/> |
| 181 |
</xsl:when> |
| 182 |
</xsl:choose> |
| 183 |
</xsl:variable> |
| 184 |
<xsl:choose> |
| 185 |
<xsl:when test="string-length($bugzillaURL) > 0"> |
| 186 |
<xsl:comment> |
| 187 |
<xsl:value-of select="$bugzillaURL"/> |
| 188 |
</xsl:comment> |
| 189 |
<xsl:apply-templates select="document($bugzillaURL)//bz:bugs"/> |
| 190 |
</xsl:when> |
| 191 |
<xsl:otherwise> |
| 192 |
<html:ul> |
| 193 |
<html:li> |
| 194 |
<html:span style="background-color: #FFCCCC; font-weight: bold; font-size: 150%;"> |
| 195 |
Error: url is not a bugs.eclipse.org url |
| 196 |
</html:span> |
| 197 |
</html:li> |
| 198 |
</html:ul> |
| 199 |
</xsl:otherwise> |
| 200 |
</xsl:choose> |
| 201 |
</xsl:template> |
| 202 |
|
| 203 |
<xsl:template match="plan:proposed"> |
| 204 |
<xsl:call-template name="ThemeBugzilla"> |
| 205 |
<xsl:with-param name="node" select="."/> |
| 206 |
<xsl:with-param name="section">Propose</xsl:with-param> |
| 207 |
</xsl:call-template> |
| 208 |
</xsl:template> |
| 209 |
|
| 210 |
<xsl:template match="plan:deferred"> |
| 211 |
<xsl:call-template name="ThemeBugzilla"> |
| 212 |
<xsl:with-param name="node" select="."/> |
| 213 |
<xsl:with-param name="section">Deferred</xsl:with-param> |
| 214 |
</xsl:call-template> |
| 215 |
</xsl:template> |
| 216 |
|
| 217 |
<xsl:template match="plan:appendix"> |
| 218 |
<h2>Appendix <xsl:value-of select="@name"/></h2> |
| 219 |
<xsl:call-template name="copyNodeorCData"> |
| 220 |
<xsl:with-param name="node" select="."/> |
| 221 |
</xsl:call-template> |
| 222 |
</xsl:template> |
| 223 |
|
| 224 |
<xsl:template name="ThemeBugzilla"> |
| 225 |
<xsl:param name="node"/> |
| 226 |
<xsl:param name="section"/> |
| 227 |
|
| 228 |
<li> |
| 229 |
<b><xsl:value-of select="$section"/></b> |
| 230 |
<ul> |
| 231 |
<li> |
| 232 |
<xsl:choose> |
| 233 |
<xsl:when test="@bugzilla"> |
| 234 |
<xsl:apply-templates select="@bugzilla"/> |
| 235 |
</xsl:when> |
| 236 |
<xsl:otherwise> |
| 237 |
<xsl:call-template name="copyNodeorCData"> |
| 238 |
<xsl:with-param name="node" select="."/> |
| 239 |
</xsl:call-template> |
| 240 |
</xsl:otherwise> |
| 241 |
</xsl:choose> |
| 242 |
</li> |
| 243 |
</ul> |
| 244 |
</li> |
| 245 |
</xsl:template> |
| 246 |
|
| 247 |
<!-- Called Templates these are common routines used by other templates --> |
| 248 |
|
| 249 |
<xsl:template name="copyNodeorCData"> |
| 250 |
<xsl:param name="node"/> |
| 251 |
<xsl:apply-templates select="$node/html:*"/> |
| 252 |
</xsl:template> |
| 253 |
|
| 254 |
|
| 255 |
<xsl:template match=" html:a | html:b | html:big | html:body | html:br | html:caption | |
| 256 |
html:cite | html:code | html:col | html:colgroup | html:dd | html:div | html:dl | html:dt | html:em | html:font | |
| 257 |
html:form | html:head | html:h1 | html:h2 | html:h3 | html:h4 | html:h5 | html:h6 | html:hr | |
| 258 |
html:i | html:img | html:link | html:li | html:ol | |
| 259 |
html:p | html:param | html:pre | html:s | html:small | html:span | html:strong | html:style | |
| 260 |
html:sub | html:sup | html:td | html:th | html:title | html:tr | html:tt | html:ul | html:var | html:table"> |
| 261 |
<xsl:element name="{local-name()}"> |
| 262 |
<xsl:copy-of select="@*"/> |
| 263 |
<xsl:apply-templates/> |
| 264 |
</xsl:element> |
| 265 |
</xsl:template> |
| 266 |
|
| 267 |
<!-- This routine from http://www.dpawson.co.uk/xsl/sect2/replace.html#d9550e61 --> |
| 268 |
<xsl:template name="replaceCharsInString"> |
| 269 |
<xsl:param name="stringIn"/> |
| 270 |
<xsl:param name="charsIn"/> |
| 271 |
<xsl:param name="charsOut"/> |
| 272 |
<xsl:choose> |
| 273 |
<xsl:when test="contains($stringIn,$charsIn)"> |
| 274 |
<xsl:value-of select="concat(substring-before($stringIn,$charsIn),$charsOut)"/> |
| 275 |
<xsl:call-template name="replaceCharsInString"> |
| 276 |
<xsl:with-param name="stringIn" select="substring-after($stringIn,$charsIn)"/> |
| 277 |
<xsl:with-param name="charsIn" select="$charsIn"/> |
| 278 |
<xsl:with-param name="charsOut" select="$charsOut"/> |
| 279 |
</xsl:call-template> |
| 280 |
</xsl:when> |
| 281 |
<xsl:otherwise> |
| 282 |
<xsl:value-of select="$stringIn"/> |
| 283 |
</xsl:otherwise> |
| 284 |
</xsl:choose> |
| 285 |
</xsl:template> |
| 286 |
|
| 287 |
|
| 288 |
</xsl:stylesheet> |