xsl-list
[Top] [All Lists]

Pagination

2003-03-17 09:11:37
I'm have created a style sheet which displays an eventlog. The stylesheet is
applied to a an XML data island which is created dynamically in an asp.
The problem I have is paginating the output of the style sheet as there are
many events in the log. I would like for the user to be able to decide how
many results, er page,they can see. The stylesheet is shown below:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
xmlns:fo="http://www.w3.org/1999/XSL/Format"; >
        <xsl:template match="/">
                <table>
                        <tr class="listhead">
                                <th onclick="vbscript:Call doSort
('event_id',dsoFilteredEvents)" style="cursor:hand" title="Order by Event
ID">Event Id</th>
                                <th onclick="vbscript:Call
doSort('event_severity',dsoFilteredEvents)" style="cursor:hand">Event
Severity</th>
                                <th onclick="vbscript:Call
doSort('event_id',dsoFilteredEvents)" style="cursor:hand">Time</th>
                                <th onclick="vbscript:Call
doSort('local_host',dsoFilteredEvents)" style="cursor:hand">Local Host</th>
                                <th onclick="vbscript:Call
doSort('component',dsoFilteredEvents)" style="cursor:hand">Component</th>
                                <th onclick="vbscript:Call
doSort('description',dsoFilteredEvents)"
style="cursor:hand">Description</th>
                                <th onclick="vbscript:Call
doSort('error_source',dsoFilteredEvents)" style="cursor:hand">Error
Source</th>
                                <th onclick="vbscript:Call
doSort('code',dsoFilteredEvents)" style="cursor:hand">Code</th>
                                <th onclick="vbscript:Call
doSort('logon_id',dsoFilteredEvents)" style="cursor:hand">Logon ID</th>
                                <th onclick="vbscript:Call
doSort('remote_host',dsoFilteredEvents)" style="cursor:hand">Remote
Host</th>
                                <th onclick="vbscript:Call
doSort('extra',dsoFilteredEvents)" style="cursor:hand">Extra</th>
                                <th onclick="vbscript:Call
doSort('source_file',dsoFilteredEvents)" style="cursor:hand">Source
File</th>
                                <th onclick="vbscript:Call
doSort('source_line',dsoFilteredEvents)" style="cursor:hand">Source
Line</th>
                                <th onclick="vbscript:Call
doSort('source_code',dsoFilteredEvents)" style="cursor:hand">Source
Code</th>
                        </tr>
                        <xsl:apply-templates select="//event">
                                <xsl:sort select="event_id"
order="ascending" data-type="text">
                                </xsl:sort>
                        </xsl:apply-templates>
                </table>
        </xsl:template>
        
        <xsl:template match="event">
                <xsl:element name="tr">
                        <xsl:choose>
                                <xsl:when test="(position() mod 2) = 0">
                                        <xsl:attribute
name="class">listEven</xsl:attribute>
                                </xsl:when>
                                <xsl:otherwise>
                                        <xsl:attribute
name="class">listOdd</xsl:attribute>
                                </xsl:otherwise>
                        </xsl:choose>
                        <td><xsl:value-of
select="event_id"></xsl:value-of></td>
                        <td><xsl:value-of
select="event_severity"></xsl:value-of></td>
                        <td><xsl:value-of
select="timestamp"></xsl:value-of></td>
                        <td><xsl:value-of
select="local_host"></xsl:value-of></td>
                        <td><xsl:value-of
select="component"></xsl:value-of></td>
                        <td><xsl:value-of
select="description"></xsl:value-of></td>
                        <td><xsl:value-of
select="error_source"></xsl:value-of></td>
                        <td><xsl:value-of select="code"></xsl:value-of></td>
                        <td><xsl:value-of
select="logon_id"></xsl:value-of></td>
                        <td><xsl:value-of
select="remote_host"></xsl:value-of></td>
                        <td><xsl:value-of
select="extra"></xsl:value-of></td>
                        <td><xsl:value-of
select="source_file"></xsl:value-of></td>
                        <td><xsl:value-of
select="source_line"></xsl:value-of></td>
                        <td><xsl:value-of
select="source_code"></xsl:value-of></td>
                </xsl:element>
        </xsl:template>
</xsl:stylesheet>


The doSort function basically allows the user to click on the column heading
to sort by that column. I know that this is going to cause big probelms with
paginating the results but at present I am having dificulties in paginating
at all. I would be grateful for any useful tips anyone has on paginting the
output of this stylesheet, which incidently is displayed within div tags.

Thanks,

Vincent



_________________________________________________________________ 
Common Services Agency Disclaimer 

The information contained in this message may be confidential 
or legally privileged and is intended for the addressee only.  
If you have received this message in error or there are any 
problems please notify the originator immediately. 
The unauthorised use, disclosure, copying or alteration of this 
message is strictly forbidden. 
_________________________________________________________________ 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>
  • Pagination, Curran,Vincent <=