Hi all,
If u know the solution please suggest me. I need these urgent.
production.xml
I want to display these element as sort with date
sort with task with in date
sort user with in task
sort etype with in user
now my xsl
Advance thanks for ur help
5 1582
Hi,
Could you re-post using code tags, otherwise it's difficult to say what row needs attention.
Thanks
jkmyoung 2,057
Recognized Expert Top Contributor
I think the word for it is subsort.
In this case you simply need an additional <xsl:sort/> element
But to be honest, I'm really not sure what you're trying to do.. the xsl is quite messy. things like
<xsl:for-each select="$report[generate-id(.) = generate-id(key('keyTask ', task)[1])]">
<xsl:sort select="task" order="ascendin g"/>
</xsl:for-each>
do absolutely nothing, and shouldn't be in the code.
Hi MarkoKlacar,
Thanks 4 ur reply. As per previous mail. I have the (etype, user, book, file, status, task, starttime, endtime, totaltime, updateto, comment) elements. Here i want display these elements in stylesheet by
Date wise then task wise (All are must be ascending order in sub sorting) then user wise like as below mentioned: Date: 2/5/2008
Task: RND
User: Thiyagu
Then display Book, file, status,........ .........
------------------------------------------------------------------------------------------ Date: 3/5/2008
Task: QC
User: Thiyagu
Then display Book, file, status,........ .........
------------------------------------------------------------------------------------------
And finally i want total time for each user by date wise.
I think this may be clear to u. Further any doubt i will like to explain details manner. (My E-mail id: kuberan.vinoth@ gmail.com)
<report>
<production>
<etype>Break</etype>
<user>thiyagu </user>
<date>2/5/2008</date>
<book>Traning </book>
<file>Programmi ng</file>
<status>WIP</status>
<task>QC</task>
<starttime>11:2 4:23 PM</starttime>
<endtime>11:46: 21 PM</endtime>
<totaltime> 22</totaltime>
<updateto/>
<comment>Tea Break</comment>
</production>
<production>
<etype>Break</etype>
<user>thiyagu </user>
<date>3/5/2008</date>
<book>Traning </book>
<file>Programmi ng</file>
<status>WIP</status>
<task>RND</task>
<starttime>11:2 4:23 PM</starttime>
<endtime>11:46: 21 PM</endtime>
<totaltime> 22</totaltime>
<updateto/>
<comment>Tea Break</comment>
</production>
------ and so on
</report
Hi,
Could you re-post using code tags, otherwise it's difficult to say what row needs attention.
Thanks
hi,
please ignore that watch the my reply to MarkoKlacar for clear doubt
I think the word for it is subsort.
In this case you simply need an additional <xsl:sort/> element
But to be honest, I'm really not sure what you're trying to do.. the xsl is quite messy. things like
<xsl:for-each select="$report[generate-id(.) = generate-id(key('keyTask ', task)[1])]">
<xsl:sort select="task" order="ascendin g"/>
</xsl:for-each>
do absolutely nothing, and shouldn't be in the code.
jkmyoung 2,057
Recognized Expert Top Contributor
This took awhile: -
<xsl:template match="report" name="ShowproductionsInTeam">
-
<xsl:for-each select="$report[generate-id(.) = generate-id(key('keyDate', date)[1])]"><!-- Get unique dates -->
-
<xsl:sort select="date" order="ascending"/>
-
<xsl:variable name="date" select="date"/>
-
<!-- output date information -->
-
<tr>
-
<td width="10%" colspan="8" align="center"><font size="5" color="Green">Date: <xsl:value-of select="date"/></font></td>
-
</tr>
-
<xsl:for-each select="key('keyDate')[generate-id(.) = generate-id(key('keyTask', concat(date,task))[1])]"> <!-- Get unique tasks within a date -->
-
<xsl:sort select="task" order="ascending"/>
-
<!-- output task information -->
-
<tr bgcolor="#9e7bff">
-
<td width="10%" colspan="8"><h3><xsl:value-of select="task"/></h3></td>
-
</tr>
-
-
<xsl:for-each select="key('keyTask', concat(date,task))[count(. | key('keyDateTaskUser', concat(date, task,user))[1]) = 1]"><!-- get unique users within a dateTask -->
-
<xsl:sort select="user" order="ascending"/>
-
<!-- output user information -->
-
<tr bgcolor="#dddddd">
-
<td width="10%" colspan="8"><font color="blue" size="4"><xsl:value-of select="user"/></font></td>
-
</tr>
-
<xsl:for-each select="key('keyDateTaskUser', concat(date, task,user))[count (. | key('keyDateTaskUserEtype',concat(date, task,user,etype))[1]) = 1]">
-
<xsl:sort select="etype" order="ascending"/> <!-- get unique etypes within a date task 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:for-each>
-
<xsl:for-each select="key('keyDateTaskUserEtype',concat(date, task,user,etype))">
-
<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:for-each><!-- etype -->
-
<tr><!-- This doesn't work, if a user is in multiple days-->
-
<th colspan="8" align="right"><font color="blue">Total time: <xsl:value-of select="sum($report[user=$user]/totaltime)" /> minutes</font></th>
-
</tr>
-
</xsl:for-each><!-- user -->
-
</xsl:for-each><!-- task -->
-
</xsl:for-each><!-- date -->
-
</xsl:template>
-
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: James P |
last post by:
Hi All,
I have an xml file as listed below. This is a list of scripts. Some of the
scripts depend on the output of other scripts. I want to sort this xml in
such a way that the scripts are listed in the correct order of execution. I
created an IComparer class and implememted the Compare method. I am calling
Array.Sort on an XmlNode array. The sorting is not correct. Can anyone
suggest a correct algorithm for a compare method to sort this...
|
by: Xah Lee |
last post by:
Sort a List
Xah Lee, 200510
In this page, we show how to sort a list in Python & Perl and also
discuss some math of sort.
To sort a list in Python, use the “sort” method. For example:
li=;
|
by: Alan Searle |
last post by:
I find that I can display structured data very nicely using XML with an
XSL template. As an extra 'goodie', I would like to give users the
ability to sort that data (for example with a button above a particular
column). What I need to know now is whether this is possible with
XML/XSL? Or do I need to resort to a programming language (maybe JScript?).
So far I have worked with the XML and XSL split into separate documents.
However, I...
|
by: Scott |
last post by:
I have a collection where the items in the collection are dates. I want to
iterate over the collection and build a value list string for the rowsource
of a listbox. The dates in the collection are not in chronological order. Is
there a way to first sort the collection and put the dates in chronological
order before creating the value list string? Or, how would I iterate over
the collection pulling out the dates in chronological order?
...
|
by: ruel loehr |
last post by:
Hey guys,
I am looking for some insight:
Given two sorted arrays of integers A and B, where array B has enough
extra room in it to hold the contents of both A and B. Merge array A
and B together such that the result is the sorted combination of the
two (do not remove duplicates) and the result resides in the B array.
I cannot perform any memory allocations to solve the problem.
| |
by: Foodbank |
last post by:
Hi everyone. I'm having trouble with this radix sorting program. I've
gotten some of it coded except for the actual sorting :( The book I'm
teaching myself with (Data Structures Using C and C++) just doesn't
explain things good at all and the tutorials I've viewed don't really
explain least significant digit first sorting or show examples, which
would be most helpful. I've commented the section where I know that
the iteration of the...
|
by: Fred Morrison |
last post by:
Do you know of a way to load a hash table with random key/value pairs (e.g.,
2/"Two",1/"One",3/"Three") and then iterate through the entries in "sorted"
(key sequence) order (1/"One",2/"Two",3/"Three")? The following just returns
them in the order they were loaded:
Dim hshPrimaryKeyInfo as New Hashtable
<snip code to Add entries to hash table>
For Each hshEntry As DictionaryEntry In hshPrimaryKeyInfo
|
by: Cerebrus99 |
last post by:
Hi all,
I am confused about how to sort an XML file. I mean how to *actually*
sort the data in the physical file, not how to display sorted data. I
am using a large XML file as a back-end database, and am making many
inserts and updates using the XmlDocument class. But I need to make the
XML file human readable too, and want to physically sort the data in
the file, every time an insert is made. At present I'm having to use a
tool like...
|
by: bcochofel |
last post by:
I'm using xsl to list an xml file that contains something like: sites,
tag and weight.
I'm listing this in a table with the following titles: | URL | TAG |
WEIGHT (each title his a link)
What I want is when someone clicks a title chooses the sorting option,
if this is the actual sorting option then reverses the order. Can I do
this? How?
|
by: Kamal |
last post by:
Hello all,
I have a very simple html table with collapsible rows and sorting
capabilities. The collapsible row is hidden with css rule
(display:none). When one clicks in the left of the expandable row, the
hidden row is made visible with css. The problem is when i sort the
rows, the hidden rows get sorted as well which i don't want and want
to be moved (while sorting) relative to their parent rows. The
following is my complete html code...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |