Click to See Complete Forum and Search --> : Resorting based on order value


XMLNewbie
05-03-2003, 10:07 AM
Hi!

The first column on my page created by an xsl file is named order. It uses the position function to fill its column of textboxes when the page is loaded. Is there a way using the resort button below that if someone changes the value of some of the order numbers and then presses the resort button that the rows will be resorted chronologically based on the value of the order field's value?

<table style="font-size: 10pt" width="100%" border="1" bordercolor= "#418181" cellpadding="2"
cellspacing="0">
<tr style="background-color:#CBCCDA">
<td COLSPAN="3" ALIGN="CENTER"><B><xsl:value-of select="ud_CustomerName"/></B></td>
</tr>
<tr style="background-color:#CBCCDA">
<th>Order</th>
<th>Name</th>
<th>Phone 1</th>
</tr>

<xsl:apply-templates select="//contact"/>
<tr style="background-color:#CBCCDA">
<td COLSPAN="3" ALIGN="CENTER"><B><xsl:text>Users: </xsl:text>
<xsl:value-of select="count(//contact)"/></B>

<INPUT TYPE="BUTTON" onclick="" VALUE="Resort"/>

</td>
</tr>
</table>
</xsl:template>

<xsl:template match="contact">
<tr>
<xsl:attribute name="bgcolor">
<xsl:choose>
<xsl:when test="position() mod 2 = 1">#F0F1F5</xsl:when>
<xsl:otherwise>#E0DFE3</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<td align="center">
<INPUT maxLength="2" name="order" size="2" value="{position()}"/>
</td>
<td align="center">
<INPUT maxLength="30" name="name" size="30" value="{con_nam}"/>
</td>
<td align="center">
<INPUT maxLength="12" name="priphone" size="12" value="{con_mph}"/>
</td>
</tr>
</xsl:template>

</xsl:stylesheet>


Thank you for any suggestions.

khalidali63
05-03-2003, 10:17 AM
I don't think you will be able to do that with XSL,Here is why
XSL is applied to xml file and then you get this table layout,once you have the table lay out,its not xml anymore,its htmlto sort it using xml you will have to run xsl file on this html file???
make sense?

XMLNewbie
05-03-2003, 10:24 AM
Hi Khalid!

Actually I do not have an xml file. The data is received from a remote website using webservices. Does this matter?

Thank you in advance.

XMLNewbie
05-03-2003, 11:10 AM
Hi!

Found this page on MSN but have no clue as to how to incorporate it into my page.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wss/wss/_exch2k_rendering_search_results_with_xsl.asp

Any ideas?