jonthequik
Programmer
I'm trying to use XML to design a table. I want this table to be sortable based on an option the user enters on the page itself. I've got it to where the user's request is posted to the page (sort of), but need to pass the variable to the attribute. The problem is that my current coding has the order-by attribute sorting by the variable itself, not the value assigned to it. What am I missing?<br><br>In the code below, I have the script capture the value from another frame. I need the order-by attribute to sort the database by that value. How?<br><br><?xml version='1.0'?><br><xsl:stylesheet xmlns:xsl="<A HREF=" TARGET="_new"> match="/"><br> <html><br><script language="JavaScript"><br>function notReady() {<br> aa = parent.one.document.form1.sortCards.selectedIndex;<br> alphaName = parent.one.document.form1.sortCards.options[aa].value;<br> bb = parent.one.document.form1.sortOrder.selectedIndex;<br> bravoName = parent.one.document.form1.sortOrder.options[bb].value;<br> sortValue = bravoName + alphaName;<br> alert(sortValue);<br>}<br></script><br> <body bgcolor="white" text="black"><CENTER><br> <H1>Triple Triad Card List</H1><br> <table border="1" bgcolor="white" BORDERCOLOR="black" CELLPADDING="3" CELLSPACING="0"><br> <tr><br> <th align="left">Monster</th><br> <th align="left">Lvl</th><br> <th align="left">Elemental</th><br> <th align="left">Class</th><br> <th align="left">Mod</th><br> <th align="left">T</th><br> <th align="left">L</th><br> <th align="left">B</th><br> <th align="left">R</th><br> </tr><br> <xsl:for-each select="TRIPLETRIAD/CARD" order-by="sortValue"><br> <tr><br> <td><xsl:value-of select="NAME"/></td><br> <td><xsl:value-of select="LEVEL"/></td><br> <td><xsl:value-of select="ELEMENTAL"/></td><br> <td><xsl:value-of select="CLASSIFICATION"/></td><br> <td><xsl:value-of select="MODIFICATION"/></td><br> <td><xsl:value-of select="TOP"/></td><br> <td><xsl:value-of select="LEFT"/></td><br> <td><xsl:value-of select="BOTTOM"/></td><br> <td><xsl:value-of select="RIGHT"/></td><br> </tr><br> </xsl:for-each><br> </table></CENTER><br> </body><br> </html><br></xsl:template><br></xsl:stylesheet><br>