[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] How can I sort values that have been calculated dynami
Hello, This is connected to my earlier thread (Sorting a Nodeset contained within a Variable), but as I haven't got that working I will try a more general approach. Here goes: My XML is a series of User elements structured as follows: <User> <User_Name></User_Name> <Case_Code></Case_Code> <Case_Title></Case_Title> <Cost_Item> <User_ID></User_ID> <Job_Description></Job_Description> <Charge_Rate></Charge_Rate> <Item_Date></Item_Date> <Item_Description></Item_Description> <Time_Minutes></Time_Minutes> <Cost></Cost> </Cost_Item> </User> There may be a number of such entries with the same User_Name and a number of those may have the same Case_Code and Case_Title. The desired output: I am outputting a table with a series of columns, each of which has a heading which, when clicked, will sort the table data according to the heading clicked. Where I am at present: Some of the columns contain data contained in the source XML (eg there are a User_Name column and a Case_Code column); when these are clicked they are sorting the data as required. The problem: Some of the columns contain data that is not directly in the source XML but is computed from it (eg there is a column containing the total number of unique Case_Code elements for each unique User_Name). I have a template matching each unique User_Name, and within this the data is being output into the table using this code: <TH> <xsl:variable name="ThisUser" select="." /> <xsl:value-of select="count(//User[./User_Name=$ThisUser][not(Case_Code=preceding::Case_Co de)])" /> </TH> however, I have not been able to code the column heading so that it sorts by this column when clicked. Any suggestions as to how to go about this? Bryan XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|