Subject: RE: [xsl] Sortable data-table From: Roel Mertens <rmertens@xxxxxxx> Date: Thu, 28 Dec 2000 08:48:22 +0100 |
See http://213.46.13.143/metalweb/subcatalogus.xsl for the XSL and for the XML: http://213.46.13.143/scripts/metalweb.exe/%HOST%/scripts/metalweb.exe/showpa ge?pagename=SubCatalogus&Product=18436 or go to http://213.46.13.143 and go to "CATALOGUS" > -----Oorspronkelijk bericht----- > Van: Koetje Boe [mailto:b_koetje@xxxxxxxxxxx] > Verzonden: woensdag 27 december 2000 14:38 > Aan: XSL-list@xxxxxxxxxxxxxxxxxxxxxx > Onderwerp: [xsl] Sortable data-table > > > > Hi, > I have a xml-file that respresents a data table, and a xsl-file that > shows this table. What I want to do is this: When a column header is > pressed(it`s a button) sort the resulting html-page on that column. > For example, my xml-file looks like: > > <?xml version="1.0" encoding="ISO8859-1"?> > <!DOCTYPE dataset PUBLIC 'datasetDTD' > http://localhost/xmlDocs/dataset.dtd'> > <?xml-stylesheet type="text/xsl" > href="http://localhost/xmlDocs/dataset.xsl"?> > <?cocoon-process type="xslt"?> > > <dataset> > <metaData> > <tableName>EMPLOYEES</tableName> > <columnInfo name="EMP_NO" type="SmallInt" size="6"/> > <columnInfo name="FIRST_NAME" type="VarChar" size="15"/> > <columnInfo name="LAST_NAME" type="VarChar" size="20"/> > </metaData> > <data> > <row> > <column name="EMP_NO">2</column> > <column name="FIRST_NAME">Robert</column> > <column name="LAST_NAME">Nelson</column> > </row> > <row> > <column name="FIRST_NAME">K. J.</column> > <column name="LAST_NAME">Weston</column> > <column name="EMP_NO">11</column> > </row> > <row> > <column name="FIRST_NAME">Luke</column> > <column name="EMP_NO">61</column> > <column name="LAST_NAME">Leung</column> > </row> > </data> > </dataset> > > And my xsl-file looks like this: > > <?xml version="1.0" encoding="UTF-8"?> > <xsl:stylesheet version="1.0" > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> > <xsl:output method="html" version="1.0" indent="yes"/> > <xsl:template match="/"> > <xsl:processing-instruction > name="cocoon-format">type="text/html"</xsl:processing-instruction> > <html> > <body> > <table border="1" width="60%" bgcolor="WHITE" cellspacing="2" > cellpadding="2" frame="border"> > <caption> > <xsl:value-of select="dataset/metaData/tableName"/> > </caption> > <tr> > <xsl:for-each select="dataset/metaData/columnInfo"> > <th> > <INPUT> > <xsl:attribute name="TYPE">SUBMIT</xsl:attribute> > <xsl:attribute name="VALUE"> > <xsl:value-of select="@name"/> > </xsl:attribute> > </INPUT> > </th> > </xsl:for-each> > </tr> > <xsl:for-each select="dataset/data/row"> > <xsl:variable name="row" select="."/> > <tr> > <xsl:for-each select="/dataset/metaData/columnInfo"> > <td> > <xsl:value-of select="$row/column[@name = > current()/@name]"/> > </td> > </xsl:for-each> > </tr> > </xsl:for-each> > </table> > </body> > </html> > </xsl:template> > </xsl:stylesheet> > > It there a way to do this? And if so, how? > Any suggestions and/or examples are greatly appreciated. > > J.S. Koldenhof > ______________________________________________________________ > ___________ > Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Sortable data-table, Koetje Boe | Thread | [xsl] ANN: Antenna House XSL Format, MURAKAMI Shinyu |
Re: [xsl] multiple XML tags -> sing, Jiri Jirat | Date | Re: [xsl] multiple XML tags -> sing, Mike Brown |
Month |