473,325 Members | 2,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Sort Column In Table (ascending) Using attributes

I have an XML doc and successfully transformed into a table using XSL.
The Challenge is how to sort the information by columns. I am writting
diffrent XSL for the diffrent sorts (i.e per column) but I can't just
get the basic one to work. I get no errors but the data is not sorted.
Please help.

1. To order by Title===@name
2. To Order by Author ===../attribute[@attid='5']
3. To order by Date === .../attribute[@attid='3']

XSL

<xsl:template match="/">
<html>
<body>
<xsl:apply-templates select="live" />
</body>
</html>
</xsl:template>

<xsl:template match="live">

<table >
<tr >
<th>Title</th>
<th>Author</th>
<th>Date</th>
</tr>
<xsl:for-each select="llnode">

<xsl:sort select = "./@name" order="descending"/>

<xsl:apply-templates select="llnode" />
</xsl:for-each>

</table>
</xsl:template>

<xsl:template match="llnode">

<tr>

<td width="44%"> <A>
<xsl:attribute name="HREF">
http://www.whateverurl.org=<xsl:value-of
select="@id"/>&amp;objAction=open </xsl:attribute>
<xsl:value-of select="@name"/> </A> </td>
<td ><xsl:value-of select="category/attributeset/attribute
[@attid='5']"/></td>

<td>
<xsl:value-of select="substring-before(category/attributeset/attribute[@attid='3'],'T')"/></td>
</tr>
</xsl:template>
</xsl:stylesheet>
Jul 20 '05 #1
1 3470
> <xsl:for-each select="llnode">

<xsl:sort select = "./@name" order="descending"/>

<xsl:apply-templates select="llnode" />
</xsl:for-each>


Why do you use the for-each?
I think this should work.

<xsl:apply-templates select="llnode">
<xsl:sort select = "./@name" order="descending"/>
</xsl:apply-templates>

Joris Gillis
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ken R. | last post by:
Hello all, I am relatively new to python but I am having an issue with custom sort functions.. I am trying to sort a list of lists or tuples with arbitrary ascending or descending sorts. For...
2
by: Alpay Eno | last post by:
Hello all... I'm using asp to get records from an access database, very similar to the way datagrid would work. The title of each column in my table is a link that alternates the sort order between...
2
by: Deano | last post by:
If I sort my table on a date in ascending order then empty dates are listed first; SELECT tblReview.ID, tblReview.ReviewDate, tblReview.NextReview FROM tblReview ORDER BY tblReview.NextReview; ...
1
by: reiks | last post by:
I have a datatable . My requirement is to sort the table rows in ascending and descending order basing on the columns which I give it. I've used the following expression ...
7
by: DC Gringo | last post by:
I have a datagrid that won't sort. The event handler is firing and return label text, just not the sort. Here's my Sub Page_Load and Sub DataGrid1_SortCommand: -------------------- Private...
1
by: Gunjan Garg | last post by:
Hello All, I am working to create a generic datagrid which accepts a datasource(ListData - This is our own datatype) and depending on the calling program customizes itself for sorting,...
11
by: Alan T | last post by:
Does the ListView supports sort? I want to have a up/down arrow/triangle that show it is sorted asc or desc on the column headers when I click the column header. May be I need a third-party...
13
by: Vbbeginner07 | last post by:
its about Sorting a list view but its not working. please help....... Private Sub ListView1_ColumnClick(ByVal ColumnHeader As MSComctlLib.ColumnHeader) 'Determine whether the column is the same...
1
by: Aeric | last post by:
I have read the following topic: sorting dataset and I am facing the same issue. I am designing a report. I have fill a dataset with the results from a query. From the results, I used to set...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.