daily pastebin goal
47%
SHARE
TWEET

alexcrown

a guest Dec 16th, 2009 358 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet version="1.0"
  3.   xmlns="urn:schemas-microsoft-com:office:spreadsheet"
  4.   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  5. xmlns:msxsl="urn:schemas-microsoft-com:xslt"
  6. xmlns:user="urn:my-scripts"
  7. xmlns:o="urn:schemas-microsoft-com:office:office"
  8. xmlns:x="urn:schemas-microsoft-com:office:excel"
  9. xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">
  10.  
  11.  
  12. <xsl:template match="/">
  13.     <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
  14.                xmlns:o="urn:schemas-microsoft-com:office:office"
  15.                xmlns:x="urn:schemas-microsoft-com:office:excel"
  16.                xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
  17.                xmlns:html="http://www.w3.org/TR/REC-html40">
  18.  <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
  19.   <WindowHeight>10005</WindowHeight>
  20.   <WindowWidth>10005</WindowWidth>
  21.   <WindowTopX>120</WindowTopX>
  22.   <WindowTopY>135</WindowTopY>
  23.   <ProtectStructure>False</ProtectStructure>
  24.   <ProtectWindows>False</ProtectWindows>
  25.  </ExcelWorkbook>
  26.  
  27.  <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
  28.   <Version>11.9999</Version>
  29.  </DocumentProperties>
  30. <Styles>
  31.   <Style ss:ID="Default" ss:Name="Normal">
  32.    <Alignment ss:Vertical="Bottom"/>
  33.    <Borders/>
  34.    <Font ss:FontName="Arial Cyr" x:CharSet="204"/>
  35.    <Interior/>
  36.    <NumberFormat/>
  37.    <Protection/>
  38.   </Style>
  39.   <Style ss:ID="s22">
  40.    <Borders>
  41.     <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>
  42.     <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
  43.     <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>
  44.     <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>
  45.    </Borders>
  46.   </Style>
  47.   <Style ss:ID="s27">
  48.    <Borders>
  49.     <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>
  50.     <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
  51.     <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>
  52.     <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>
  53.    </Borders>
  54.    <NumberFormat ss:Format="dd/mm/yy;@"/>
  55.   </Style>
  56.   <Style ss:ID="s28">
  57.    <NumberFormat ss:Format="dd/mm/yy;@"/>
  58.   </Style>
  59.   <Style ss:ID="s29">
  60.    <Alignment ss:Vertical="Bottom" ss:WrapText="1"/>
  61.    <Borders>
  62.     <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>
  63.     <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
  64.     <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>
  65.     <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>
  66.    </Borders>
  67.    <Font ss:FontName="Arial Cyr" x:CharSet="204" ss:Bold="1"/>
  68.    <Interior ss:Color="#C0C0C0" ss:Pattern="Solid"/>
  69.   </Style>
  70.   <Style ss:ID="s30">
  71.    <Alignment ss:Vertical="Bottom" ss:WrapText="1"/>
  72.    <Borders>
  73.     <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>
  74.     <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
  75.     <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>
  76.     <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>
  77.    </Borders>
  78.    <Font ss:FontName="Arial Cyr" x:CharSet="204" ss:Bold="1"/>
  79.    <Interior ss:Color="#C0C0C0" ss:Pattern="Solid"/>
  80.    <NumberFormat ss:Format="dd/mm/yy;@"/>
  81.   </Style>
  82.   <Style ss:ID="s31">
  83.    <Alignment ss:Vertical="Bottom" ss:WrapText="1"/>
  84.   </Style>
  85.  </Styles>
  86.  
  87.         <Worksheet ss:Name="Report">
  88.             <Table x:FullColumns="1"  x:FullRows="1">
  89.                 <Column ss:Index="2" ss:AutoFitWidth="0" ss:Width="123"/>
  90.                 <Column ss:AutoFitWidth="0" ss:Width="78.75"/>
  91.                 <Column ss:AutoFitWidth="0" ss:Width="187.5"/>
  92.                 <Column ss:AutoFitWidth="0" ss:Width="246"/>
  93.                 <Column ss:StyleID="s28" ss:AutoFitWidth="0" ss:Width="64.5" ss:Span="3"/>
  94.                 <Column ss:Index="10" ss:AutoFitWidth="0" ss:Width="108.75"/>
  95.                 <Column ss:AutoFitWidth="0" ss:Width="95.25"/>
  96.                 <Column ss:AutoFitWidth="0" ss:Width="87.75"/>
  97.                 <Column ss:AutoFitWidth="0" ss:Width="164.25"/>
  98.                 <Row ss:Height="38.25" ss:StyleID="s31">
  99.                         <Cell ss:StyleID="s29"><Data ss:Type="String">Number</Data><NamedCell
  100.                        ss:Name="_FilterDatabase"/></Cell>
  101.                         <Cell ss:StyleID="s29"><Data ss:Type="String">Module udf</Data><NamedCell
  102.                        ss:Name="_FilterDatabase"/></Cell>
  103.                         <Cell ss:StyleID="s29"><Data ss:Type="String">Category</Data><NamedCell
  104.                        ss:Name="_FilterDatabase"/></Cell>
  105.                         <Cell ss:StyleID="s29"><Data ss:Type="String">Name</Data><NamedCell
  106.                        ss:Name="_FilterDatabase"/></Cell>
  107.                         <Cell ss:StyleID="s29"><Data ss:Type="String">Description</Data><NamedCell
  108.                        ss:Name="_FilterDatabase"/></Cell>
  109.                         <Cell ss:StyleID="s30"><Data ss:Type="String">Submit date</Data><NamedCell
  110.                        ss:Name="_FilterDatabase"/></Cell>
  111.                         <Cell ss:StyleID="s30"><Data ss:Type="String">Update date</Data><NamedCell
  112.                        ss:Name="_FilterDatabase"/></Cell>
  113.                         <Cell ss:StyleID="s30"><Data ss:Type="String">Close date</Data><NamedCell
  114.                        ss:Name="_FilterDatabase"/></Cell>
  115.                         <Cell ss:StyleID="s30"><Data ss:Type="String">Deadline udf</Data><NamedCell
  116.                        ss:Name="_FilterDatabase"/></Cell>
  117.                         <Cell ss:StyleID="s29"><Data ss:Type="String">Submitter</Data><NamedCell
  118.                        ss:Name="_FilterDatabase"/></Cell>
  119.                         <Cell ss:StyleID="s29"><Data ss:Type="String">Handler</Data><NamedCell
  120.                        ss:Name="_FilterDatabase"/></Cell>
  121.                         <Cell ss:StyleID="s29"><Data ss:Type="String">Priority</Data><NamedCell
  122.                        ss:Name="_FilterDatabase"/></Cell>
  123.                         <Cell ss:StyleID="s29"><Data ss:Type="String">Statuts</Data><NamedCell
  124.                        ss:Name="_FilterDatabase"/></Cell>
  125.                 </Row>
  126.  
  127.                 <xsl:apply-templates select="trackstudio-task/task"/>
  128.             </Table>
  129.             <AutoFilter x:Range="R1C1:R1C13" xmlns="urn:schemas-microsoft-com:office:excel">
  130.             </AutoFilter>
  131.         </Worksheet>
  132.     </Workbook>
  133. </xsl:template>
  134.  
  135. <xsl:template match="trackstudio-task/task">
  136.     <Row>
  137.         <Cell ss:StyleID="s22"><Data ss:Type="String">
  138.             <xsl:value-of select="number" />
  139.         </Data></Cell>
  140.         <Cell ss:StyleID="s22"><Data ss:Type="String">
  141.             <xsl:apply-templates select="udfs/udf[@name='Module']" />
  142.         </Data></Cell>
  143.         <Cell ss:StyleID="s22"><Data ss:Type="String">
  144.             <xsl:value-of select="category" />
  145.         </Data></Cell>
  146.         <Cell ss:StyleID="s22"><Data ss:Type="String">
  147.             <xsl:value-of select="name" />
  148.         </Data></Cell>
  149.         <Cell ss:StyleID="s22"><Data ss:Type="String">
  150.             <xsl:value-of select="description" />
  151.         </Data></Cell>
  152.         <xsl:choose>
  153.             <xsl:when test="string-length(submitdate) &gt; 0">
  154.                 <Cell ss:StyleID="s27"><Data ss:Type="DateTime">
  155.                     <xsl:call-template name="FormatDate">
  156.                         <xsl:with-param name="DateTime" select="submitdate"/>
  157.                     </xsl:call-template>
  158.                 </Data></Cell>
  159.             </xsl:when>
  160.             <xsl:otherwise>
  161.                 <Cell ss:StyleID="s27"><Data ss:Type="String">
  162.                     <xsl:value-of select="submitdate" />
  163.                 </Data></Cell>
  164.             </xsl:otherwise>
  165.         </xsl:choose>
  166.         <xsl:choose>
  167.             <xsl:when test="string-length(updatedate) &gt; 0">
  168.                 <Cell ss:StyleID="s27"><Data ss:Type="DateTime">
  169.                     <xsl:call-template name="FormatDate">
  170.                         <xsl:with-param name="DateTime" select="updatedate"/>
  171.                     </xsl:call-template>
  172.                 </Data></Cell>
  173.             </xsl:when>
  174.             <xsl:otherwise>
  175.                 <Cell ss:StyleID="s27"><Data ss:Type="String">
  176.                     <xsl:value-of select="updatedate" />
  177.                 </Data></Cell>
  178.             </xsl:otherwise>
  179.         </xsl:choose>
  180.         <xsl:choose>
  181.             <xsl:when test="string-length(closedate) &gt; 0">
  182.                 <Cell ss:StyleID="s27"><Data ss:Type="DateTime">
  183.                     <xsl:call-template name="FormatDate">
  184.                         <xsl:with-param name="DateTime" select="closedate"/>
  185.                     </xsl:call-template>
  186.                 </Data></Cell>
  187.             </xsl:when>
  188.             <xsl:otherwise>
  189.                 <Cell ss:StyleID="s27"><Data ss:Type="String">
  190.                     <xsl:value-of select="closedate" />
  191.                 </Data></Cell>
  192.             </xsl:otherwise>
  193.         </xsl:choose>
  194.         <xsl:choose>
  195.             <xsl:when test="string-length(udfs/udf[@name='&#1057;&#1076;&#1077;&#1083;&#1072;&#1090;&#1100; &#1076;&#1086; &#1076;&#1072;&#1090;&#1099;']) &gt; 0">
  196.                 <Cell ss:StyleID="s27"><Data ss:Type="DateTime">
  197.                     <xsl:call-template name="FormatDate">
  198.                         <xsl:with-param name="DateTime" select="udfs/udf[@name='Deadline udf']"/>
  199.                     </xsl:call-template>
  200.                 </Data></Cell>
  201.             </xsl:when>
  202.             <xsl:otherwise>
  203.                 <Cell ss:StyleID="s27"><Data ss:Type="String">
  204.                     <xsl:value-of select="udfs/udf[@name='Deadline udf']" />
  205.                 </Data></Cell>
  206.             </xsl:otherwise>
  207.         </xsl:choose>
  208.  
  209.         <Cell ss:StyleID="s22"><Data ss:Type="String">
  210.             <xsl:value-of select="submitter" />
  211.         </Data></Cell>
  212.         <Cell ss:StyleID="s22"><Data ss:Type="String">
  213.             <xsl:value-of select="handler" />
  214.         </Data></Cell>
  215.         <Cell ss:StyleID="s22"><Data ss:Type="String">
  216.             <xsl:value-of select="priority" />
  217.         </Data></Cell>
  218.         <Cell ss:StyleID="s22"><Data ss:Type="String">
  219.             <xsl:value-of select="status" />
  220.         </Data></Cell>
  221.     </Row>
  222. </xsl:template>
  223.  
  224. <xsl:template match="udf">
  225.     <xsl:value-of select="@value" />
  226. </xsl:template>
  227.  
  228. <!-- old date format "23.11.09 15:40" -->
  229. <xsl:template name="FormatDate">
  230.  
  231.     <xsl:param name="DateTime" />
  232.  
  233.     <!-- new date format 2006-01-14T08:55:22 -->
  234.     <xsl:if test="string-length($DateTime) &gt; 0">
  235.         <xsl:variable name="day">
  236.             <xsl:value-of select="substring($DateTime,1,2)" />
  237.         </xsl:variable>
  238.  
  239.         <xsl:variable name="mo">
  240.             <xsl:value-of select="substring($DateTime,4,2)" />
  241.         </xsl:variable>
  242.  
  243.         <xsl:variable name="year">
  244.             <xsl:value-of select="substring($DateTime,7,2)" />
  245.         </xsl:variable>
  246.        
  247.         <xsl:variable name="time">
  248.             <xsl:value-of select="substring-after($DateTime,' ')" />
  249.         </xsl:variable>
  250.        
  251.         <xsl:variable name="hh">
  252.             <xsl:value-of select="substring-before($time,':')" />
  253.         </xsl:variable>
  254.  
  255.         <xsl:variable name="mm">
  256.             <xsl:value-of select="substring-after($time,':')" />
  257.         </xsl:variable>
  258.  
  259.         <xsl:text>20</xsl:text>
  260.         <xsl:value-of select="$year"/>
  261.         <xsl:value-of select="'-'"/>
  262.         <xsl:value-of select="$mo"/>
  263.         <xsl:value-of select="'-'"/>
  264.         <xsl:value-of select="$day"/>
  265.         <xsl:value-of select="'T'"/>
  266.        
  267.         <xsl:if test="(string-length($hh) &lt; 2)">
  268.             <xsl:value-of select="0"/>
  269.         </xsl:if>
  270.         <xsl:value-of select="$hh"/>
  271.        
  272.         <xsl:value-of select="':'"/>
  273.         <xsl:value-of select="$mm"/>
  274.         <xsl:value-of select="':'"/>
  275.         <xsl:text>00.000</xsl:text>
  276.     </xsl:if>
  277.     </xsl:template>
  278. </xsl:stylesheet>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top