If u know the solution please suggest me. I need these urgent.
production.xml
Expand|Select|Wrap|Line Numbers
- <?xml version="1.0" encoding="UTF-8"?>
- <?xml-stylesheet type="text/xsl" href="xsl/vinoth-new.xsl"?>
- <report>
- <production>
- <etype>Break</etype>
- <user>thiyagu</user>
- <date>3/5/2008</date>
- <book>Traning</book>
- <file>Programming</file>
- <status>WIP</status>
- <task>RND</task>
- <starttime>11:24:23 PM</starttime>
- <endtime>11:46:21 PM</endtime>
- <totaltime> 22</totaltime>
- <updateto/>
- <comment>Tea Break</comment>
- </production>
- <production>
- <etype>Break</etype>
- <user>saravanan</user>
- <date>3/5/2008</date>
- <book>Traning</book>
- <file>Programming</file>
- <status>WIP</status>
- <task>RND</task>
- <starttime>11:24:23 PM</starttime>
- <endtime>11:46:21 PM</endtime>
- <totaltime>5</totaltime>
- <updateto/>
- <comment>Tea Break</comment>
- </production>
- <production>
- <etype>Job</etype>
- <user>sai</user>
- <date>3/6/2008</date>
- <book>aw</book>
- <file>`af</file>
- <status>ar </status>
- <task>Template</task>
- <starttime>2:23:58 PM</starttime>
- <endtime>2:24:05 PM</endtime>
- <totaltime> 1</totaltime>
- <updateto>awd </updateto>
- <comment>ef</comment>
- </production>
- <production>
- <etype>job</etype>
- <user>saravanan</user>
- <date>3/5/2008</date>
- <book>Traning</book>
- <file>Programming</file>
- <status>WIP</status>
- <task>RND</task>
- <starttime>01:46:21 PM</starttime>
- <endtime>02:46:21 PM</endtime>
- <totaltime>2</totaltime>
- <updateto/>
- <comment>QC pending</comment>
- </production>
- <production>
- <etype>Job</etype>
- <user>kapil</user>
- <date>3/6/2008</date>
- <book>dcadcad</book>
- <file>adcadc</file>
- <status>OVER</status>
- <task>XML</task>
- <starttime>2:19:02 AM</starttime>
- <endtime>2:19:19 PM</endtime>
- <totaltime> 0</totaltime>
- <updateto>adcadcac</updateto>
- <comment>adcadca</comment>
- </production>
- <production>
- <etype>Job</etype>
- <user>ksaravanan</user>
- <date>3/6/2008</date>
- <book>aw</book>
- <file>`af</file>
- <status>ar</status>
- <task>Template</task>
- <starttime>2:23:58 PM</starttime>
- <endtime>2:24:05 PM</endtime>
- <totaltime> 1</totaltime>
- <updateto>awd</updateto>
- <comment>ef</comment>
- </production>
- <production>
- <etype>Job</etype>
- <user>vinoth</user>
- <date>3/6/2008</date>
- <book>meiners</book>
- <file>chapter4</file>
- <status>qc</status>
- <task>XML</task>
- <starttime>6:52:44 PM</starttime>
- <endtime>6:53:36 PM</endtime>
- <totaltime> 1</totaltime>
- <updateto>add</updateto>
- <comment>xfb </comment>
- </production>
- <production>
- <etype>Break</etype>
- <user>vinoth</user>
- <date>3/6/2008</date>
- <book>meiners</book>
- <file>chapter4</file>
- <status>qc</status>
- <task>XML</task>
- <starttime>6:52:44 PM</starttime>
- <endtime>6:53:36 PM</endtime>
- <totaltime> 1</totaltime>
- <updateto>add</updateto>
- <comment>xfb </comment>
- </production>
- </report>
sort with date
sort with task with in date
sort user with in task
sort etype with in user
now my xsl
Expand|Select|Wrap|Line Numbers
- <?xml version="1.0" encoding="UTF-8"?>
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:output method="html" encoding="ISO-8859-1" doctype-public="-//W3C//DTD HTML 4.0 Transitional//EN"/>
- <xsl:variable name="report" select="//production"/>
- <!-- Define keys used to group elements -->
- <xsl:key name="keyDate" match="production" use="date" />
- <xsl:key name="keyUser" match="production" use="user" />
- <xsl:key name="keyTask" match="production" use="task" />
- <xsl:key name="keyEtype" match="production" use="etype" />
- <xsl:template match="/">
- <html>
- <head>
- <title>Cengage Production Report</title>
- </head>
- <body>
- <center>****************************************</center>
- <center><font size="6" color="brown">PreMedia Global P. Ltd.</font>
- </center>
- <center>****************************************</center>
- <center><font size="4" color="blue">Cengage Production Report</font></center><br/>
- <table width="80%" frame="box" border="2" align="center">
- <tbody>
- <xsl:apply-templates/>
- </tbody>
- </table>
- </body>
- </html>
- </xsl:template>
- <xsl:template match="report" name="ShowproductionsInTeam">
- <xsl:for-each select="$report">
- <xsl:sort select="date" order="ascending"/>
- <xsl:for-each select="$report[generate-id(.) = generate-id(key('keyTask', task)[1])]">
- <xsl:sort select="task" order="ascending"/>
- </xsl:for-each>
- <xsl:variable name="date" select="date"/>
- <xsl:if test="generate-id(.)=generate-id($report[date=$date])">
- <tr>
- <td width="10%" colspan="8" align="center"><font size="5" color="Green">Date: <xsl:value-of select="date"/></font></td>
- </tr>
- </xsl:if>
- <xsl:for-each select="$report[generate-id(.) = generate-id(key('keyDate', date)[1])]">
- <xsl:sort select="task" order="ascending"/>
- </xsl:for-each>
- <xsl:variable name="task" select="task"/>
- <xsl:if test="generate-id(.)=generate-id($report[task=$task]) or generate-id(.)=generate-id($report[date=$date])">
- <tr bgcolor="#9e7bff">
- <td width="10%" colspan="8"><h3><xsl:value-of select="task"/></h3></td>
- </tr>
- </xsl:if>
- <xsl:for-each select="$report[generate-id(.) = generate-id(key('keyDate', date)[1])]">
- <xsl:sort select="user" order="ascending"/>
- </xsl:for-each>
- <xsl:variable name="user" select="user"/>
- <xsl:if test="generate-id(.)=generate-id($report[user=$user]) or generate-id(.)=generate-id($report[date=$date])">
- <tr bgcolor="#dddddd">
- <td width="10%" colspan="8"><font color="blue" size="4"><xsl:value-of select="user"/></font></td>
- </tr>
- </xsl:if>
- <xsl:for-each select="$report[generate-id(.) = generate-id(key('keyUser', user)[1])]">
- <xsl:sort select="etype" order="ascending"/>
- </xsl:for-each>
- <xsl:variable name="etype" select="etype"/>
- <xsl:if test="generate-id(.)=generate-id($report[etype=$etype]) or generate-id(.)=generate-id($report[user=$user])">
- <tr>
- <th width="10%">Book</th>
- <th width="10%">File</th>
- <th width="10%">Status</th>
- <th width="10%">Start Time</th>
- <th width="10%">End Time</th>
- <th width="10%">Total time</th>
- <th width="10%">Updated To</th>
- <th width="10%">Comment</th>
- </tr>
- </xsl:if>
- <tr>
- <td width="10%" bgcolor="#dddddd"><xsl:value-of select="book" /></td>
- <td width="10%" bgcolor="#dddddd"><xsl:value-of select="file" /></td>
- <td width="10%" bgcolor="#dddddd"><xsl:value-of select="status" /></td>
- <td width="10%" bgcolor="#dddddd"><xsl:value-of select="starttime" /></td>
- <td width="10%" bgcolor="#dddddd"><xsl:value-of select="endtime" /></td>
- <td width="10%" bgcolor="#dddddd"><xsl:value-of select="totaltime" /></td>
- <td width="10%" bgcolor="#dddddd"><xsl:value-of select="updateto" /></td>
- <td width="10%" bgcolor="#dddddd"><xsl:value-of select="comment" /></td>
- </tr>
- <xsl:variable name="totaltime" select="totaltime"/>
- <xsl:if test="generate-id(.)=generate-id($report[user=$user]) ">
- <tr>
- <th colspan="8" align="right"><font color="blue">Total time: <xsl:value-of select="sum($report[user=$user]/totaltime)" /> minutes</font></th>
- </tr>
- </xsl:if>
- </xsl:for-each>
- </xsl:template>
- </xsl:stylesheet>
Advance thanks for ur help