Created
September 4, 2012 07:35
-
-
Save valsteen/3618030 to your computer and use it in GitHub Desktop.
XSL to transform jira stories ( issue navigator -> view as XML ) as printable slides
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<xsl:stylesheet version="1.0" | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
> | |
<!-- | |
note : customfield_10002 may change depending on your jira setup. Inspect your xml output to insert the replace with the relevant field ID. | |
--> | |
<xsl:output method="html"/> | |
<xsl:template match="/"> | |
<style> | |
@media print{@page {size: landscape}} | |
body { | |
border: 0; | |
padding: 0; | |
margin: 0; | |
} | |
table { | |
width: 100%; | |
border-collapse: collapse; | |
page-break-after: always; | |
page-break-inside: avoid; | |
height: 160mm; | |
margin: auto; | |
} | |
table tr.header { | |
height: auto; | |
} | |
table tr.header .storypoints, table tr.header .key { | |
width: 6ex; | |
white-space: nowrap; | |
} | |
table .summary { | |
width: 80%; | |
} | |
table tr .component { | |
width: 20%; | |
height: 2em; | |
} | |
table tr.content { | |
height: 100%; | |
page-break-inside: avoid; | |
} | |
table tr.content td { | |
vertical-align: top; | |
padding: 2cm; | |
} | |
table tr td { | |
border: 1px solid #000; | |
padding: 5px; | |
} | |
</style> | |
<xsl:apply-templates select="/rss/channel"/> | |
</xsl:template> | |
<xsl:template match="/rss/channel"> | |
<xsl:apply-templates select="item"/> | |
</xsl:template> | |
<xsl:template match="/rss/channel/item"> | |
<table> | |
<tr class="header"> | |
<td class="key"> | |
<xsl:value-of select="key"/> | |
</td> | |
<td class="summary"> | |
<xsl:value-of select="summary"/> | |
</td> | |
<td class="storypoints"> | |
<xsl:value-of select="customfields/customfield[@id='customfield_10002']/customfieldvalues/customfieldvalue"/> | |
</td> | |
</tr> | |
<tr class="content"> | |
<td colspan="3"> | |
<xsl:value-of select="description" disable-output-escaping="yes"/> | |
</td> | |
</tr> | |
<tr> | |
<td colspan="3" class="component"><xsl:value-of select="component" disable-output-escaping="yes"/></td> | |
</tr> | |
</table> | |
</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment