I've got a XML document and and XSL one that formats it into a table witht the following headers (and first row)
=
duration - cost - date - time - number
00:02:54 £1.80 10/02/01 14:54 07444748132
=
etc..
I would like to be able to click the headers of each row and have the page resort. I'm not able to use asp, or anything.. and currently am doing it all client side (as i'm very much a "new" user at xml/xslt.
here is a sample of my xml:
==============
<itemised_invoice no="2">
<sub_no no="383928">
<account_no>54555831</account_no>
<totalcost>105.33</totalcost>
<totalcalls>302</totalcalls>
<subphone>079895560</subphone>
<call_record id="1">
<time>10:45</time>
<date>10/08/2001</date>
<duration>01:20:45</duration>
<cost>£0.94</cost>
<bundled>no</bundled>
<ph_number>0788984432</ph_number>
</call_record>
...
...
...
================
and my xsl:
==============
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="<xsl:template match="/">
<html>
<body>
<table border="0">
<tr>
<th>Time</th>
<th>Date</th>
<th>Number</th>
<th>Cost</th>
<th>Bundled</th>
<th>Duration</th>
</tr>
<xsl:for-each select="itemised_invoice/sub_no/call_record">
<xsl:choose>
<xsl:when test="position() mod 2> 0">
<tr bgcolor="lightblue">
<td><xsl:value-of select="time"/></td>
<td><xsl:value-of select="date"/></td>
<td><xsl:value-of select="ph_number"/></td>
<td><xsl:value-of select="cost"/></td>
<td><xsl:value-of select="bundled"/></td>
<td><xsl:value-of select="duration"/></td>
</tr>
</xsl:when>
<xsltherwise>
<tr bgcolor="white">
<td><xsl:value-of select="time"/></td>
<td><xsl:value-of select="date"/></td>
<td><xsl:value-of select="ph_number"/></td>
<td><xsl:value-of select="cost"/></td>
<td><xsl:value-of select="bundled"/></td>
<td><xsl:value-of select="duration"/></td>
</tr>
</xsltherwise>
</xsl:choose>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
=================
any help would be apreciated.
Mischa
=
duration - cost - date - time - number
00:02:54 £1.80 10/02/01 14:54 07444748132
=
etc..
I would like to be able to click the headers of each row and have the page resort. I'm not able to use asp, or anything.. and currently am doing it all client side (as i'm very much a "new" user at xml/xslt.
here is a sample of my xml:
==============
<itemised_invoice no="2">
<sub_no no="383928">
<account_no>54555831</account_no>
<totalcost>105.33</totalcost>
<totalcalls>302</totalcalls>
<subphone>079895560</subphone>
<call_record id="1">
<time>10:45</time>
<date>10/08/2001</date>
<duration>01:20:45</duration>
<cost>£0.94</cost>
<bundled>no</bundled>
<ph_number>0788984432</ph_number>
</call_record>
...
...
...
================
and my xsl:
==============
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="<xsl:template match="/">
<html>
<body>
<table border="0">
<tr>
<th>Time</th>
<th>Date</th>
<th>Number</th>
<th>Cost</th>
<th>Bundled</th>
<th>Duration</th>
</tr>
<xsl:for-each select="itemised_invoice/sub_no/call_record">
<xsl:choose>
<xsl:when test="position() mod 2> 0">
<tr bgcolor="lightblue">
<td><xsl:value-of select="time"/></td>
<td><xsl:value-of select="date"/></td>
<td><xsl:value-of select="ph_number"/></td>
<td><xsl:value-of select="cost"/></td>
<td><xsl:value-of select="bundled"/></td>
<td><xsl:value-of select="duration"/></td>
</tr>
</xsl:when>
<xsltherwise>
<tr bgcolor="white">
<td><xsl:value-of select="time"/></td>
<td><xsl:value-of select="date"/></td>
<td><xsl:value-of select="ph_number"/></td>
<td><xsl:value-of select="cost"/></td>
<td><xsl:value-of select="bundled"/></td>
<td><xsl:value-of select="duration"/></td>
</tr>
</xsltherwise>
</xsl:choose>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
=================
any help would be apreciated.
Mischa