DataIsland + Sort + link on JavaScript
Hi all,
I need to do the following
I have an XML file with a XSL, I would like to create a DataIsland and put this data into a table, sort this table , and show 2 records on each page.
To do this I have the following
---BEGIN XML FILE
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="ISLA_XSL.xsl"?>
<LIBROS>
<LIBRO>
<ID>1</ID>
<TITULO>Libro2</TITULO>
</LIBRO>
<LIBRO>
<ID>4</ID>
<TITULO>Libro3</TITULO>
</LIBRO>
<LIBRO>
<ID>2</ID>
<TITULO>Libro4</TITULO>
</LIBRO>
<LIBRO>
<ID>3</ID>
<TITULO>Libro1</TITULO>
</LIBRO>
</LIBROS>
---END XML FILE
--BEGIN XSL FILE
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<HTML>
<HEAD>
<TITLE></TITLE>
<SCRIPT LANGUAGE="vbscript">
Sub anterior_onclick
Tabla.PreviousPage
End Sub
Sub siguiente_onclick
Tabla.NextPage
End Sub
</SCRIPT>
</HEAD>
<BODY>
<Table DataSRC="#datos" datapagesize="2" border="1" id="Tabla">
<thead>
<tr>
<TH>Titulo</TH>
</tr>
</thead>
<TBody>
<tr>
<td><input type="text" DataFLD="TITULO"></input></td>
<td><a href="test.asp"><span DATAFLD="ID"></span></a></td>
</tr>
</TBody>
</Table>
<INPUT id="Anterior" style="LEFT: 173px; TOP: 39px" type="button" value="Anterior"></INPUT>
<INPUT id="siguiente" style="LEFT: 173px; TOP: 39px" type="button" value="Siguiente"></INPUT>
<XML ID="Datos">
<LIBROS>
<xsl:apply-templates select="//LIBRO">
<xsl:sort select="TITULO"></xsl:sort>
</xsl:apply-templates>
</LIBROS>
</XML>
</BODY>
</HTML>
</xsl:template>
<xsl:template match="LIBRO">
<LIBRO>
<ID><xsl:value-of select="ID"></xsl:value-of></ID>
<TITULO><xsl:value-of select="TITULO"></xsl:value-of></TITULO>
</LIBRO>
</xsl:template>
</xsl:stylesheet>
--END XSL FILE
With this I can create a table sort the XML file by TITULO, and create a pagination inside table. This is running ok, but I need that the link on Id would be on this way :
<a href="test.asp?id=*>ID</a>, where * is the ID on XML file, i can´t put this because into a table with DATASRC I only can show xml file into the span, div or input tags with the parameter DATAFLD="XML_ELEMENT"
Anybody know if is posible to do this?
Thanks to all.
PD: Sorry for my english.
|