Hello everybody,
    I'm sorry but I saw that my last mail with the code was blocked... here
I send it again, this time I'm just pasting it here, I hope this helps :)


Ivan


xml file
_____________________________________________-

<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- edited with XML Spy v3.5 NT (http://www.xmlspy.com) by  () -->
<?xml:stylesheet type="text/xsl" version="1.0"  href="manuales.xsl"
encoding="ISO-8859-1"?>
<tutoriales >
  <manual>
  <nombre>XHTML v1.0</nombre>
  <tam>240</tam>
  <formato>HTML</formato>
  <idioma>Ingl�s</idioma>
  <url>http://spain3/manuales/xhtml1</url>
  <Comentarios>Especificaci�n del XHTML.</Comentarios>
 </manual>
 <manual>
  <nombre>CURSO DE USUARIO DE INTERNET</nombre>
  <tam>76</tam>
  <formato>HTML</formato>
  <idioma>Espa�ol</idioma>
  <url>http://spain3/manuales/internet.htm</url>
  <Comentarios/>
 </manual>
 <manual>
  <nombre>Intercambio Electr�nico de Datos</nombre>
  <tam>2.250</tam>
  <formato>WORD</formato>
  <idioma>Espa�ol</idioma>
  <url>http://spain3/manuales/Ied1_1/ied.doc</url>
  <Comentarios/>
 </manual>
 <manual>
  <nombre>Manual de Referencia
    Lotus Notes</nombre>
  <tam>1.183</tam>
  <formato>WORD</formato>
  <idioma>Espa�ol</idioma>
  <url>http://spain3/manuales/Libro Lotus Notes R5.doc</url>
  <Comentarios/>
 </manual>
 <manual>
  <nombre>Teach Yourself SQL in 21 Days, Second Edition</nombre>
  <tam>1.143</tam>
  <formato>HTML</formato>
  <idioma>Ingl�s</idioma>
  <url>http://spain3/manuales/aprendeSQLen21dias</url>
  <Comentarios/>
 </manual>
</tutoriales>


xsl __________________________________________________________-

<?xml version="1.0" encoding="ISO-8859-1"?>

<!-- Note that this stylesheet relies on the XMLDocument and XSLDocument
properties and thus
     only works when browsing XML -->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl";>



  <xsl:template match="/">
    <HTML>
      <HEAD>

        <STYLE>
          BODY {margin:0; }
          a {color=teal;cursor=hand;}
    a:hover {color=red;}
          .bg {font:8pt Verdana; background-color:purple; color:white}
          .row {font:8pt Verdana; border-bottom:1px solid #CC88CC}
          .header {font:bold 9pt Verdana; cursor:hand; padding:2px;
border:2px outset gray}
    .titulo {font:14pt Verdana;background-color:white; color:#006699;
position:relative; left=50;}
    .boton           { background-color: #FFCC66; }
        </STYLE>

      </HEAD>

      <SCRIPT><![CDATA[




        function sort(field)
        {
          sortField.value = field;

        // Si te preguntas qu� co�o hace esto (buena pregunta) pues resulta
que reescribe el c�digo HTML que
        // viene a continuaci�n de la llamada a esta funci�n...

          listing.innerHTML =
source.documentElement.transformNode(stylesheet);


        }

        function ves(surl)
        {


        location.href=surl;
        }


      ]]>

      </SCRIPT>

      <SCRIPT for="window" event="onload"><![CDATA[
        stylesheet = document.XSLDocument;
        source = document.XMLDocument;
        sortField = document.XSLDocument.selectSingleNode("//@order-by");

      ]]></SCRIPT>

      <BODY>
        <BR/><div align="center" class="titulo"><p>Manuales disponibles en
Spain3</p></div>
        <div aling="center"><TABLE width="90%" cellspacing="0">

          <TR>

            <TD class="bg" valign="top">
              <DIV id="listing"><xsl:apply-templates
match="tutoriales"/></DIV>
            </TD>
          </TR>
        </TABLE></div> <br/><br/>
          <FORM METHOD="POST" ENCTYPE="multipart/form-data"
ACTION="asp/uploadexmple.asp">
   <TABLE BORDER="0">
   <tr><td><b>Sube un manual! (a�n no funciona! pero tiempo al
tiempo)</b></td></tr>
   <tr><td><b>Elige el Manual a subir:</b><br/><INPUT TYPE="FILE" SIZE="50"
NAME="FILE1"/></td></tr>
   <tr><td><b>Save To:</b>Subir
   <INPUT TYPE="RADIO" NAME="saveto" value="disk" checked="checked"/>
   </td></tr>
   <tr><td align="center"><INPUT TYPE="SUBMIT" VALUE="subir!"/></td></tr>
   </TABLE>
  </FORM>
        <br/>
      </BODY>
    </HTML>
  </xsl:template>

  <xsl:template match="tutoriales">
    <TABLE STYLE="background-color:white" width="90%">
      <THEAD>
        <TD width="50%"><DIV class="header"
onClick="sort('nombre')">Nombre</DIV></TD>
        <TD width="6%"><DIV  class="header" onClick="sort('tam')
">Tama�o</DIV></TD>
        <TD width="6%"><DIV class="header"
onClick="sort('formato')">Formato</DIV></TD>
        <TD width="6%"><DIV class="header"
onClick="sort('idioma')">Idioma</DIV></TD>

      </THEAD>

      <!-- Este es el problema de no poder ordenar bien por n�meros...

         Cualquier intento de modificaci�n de este c�digo, utilizando las
transformaciones XSL
         Nos lleva a que el c�digo anterior no es aceptado... una l�stima,
vaya :)
      -->
      <xsl:for-each select="manual"   order-by="nombre" >
        <TR>

          <TD onmouseover="this.className='boton';"
onmouseout="this.className=''">
          <DIV class="row">


          <a src="." onClick="ves(this.id)">
          <xsl:attribute name="id">

           <xsl:value-of select="url"/>

          </xsl:attribute>


          <xsl:value-of select="nombre"/></a>
          </DIV>
          </TD>
          <TD><DIV class="row" STYLE="text-align:right"><xsl:value-of
select="tam"/></DIV></TD>
          <TD><DIV class="row" STYLE="text-align:right"><xsl:value-of
select="formato"/></DIV></TD>
          <TD><DIV class="row" STYLE="text-align:right"><xsl:value-of
select="idioma"/></DIV></TD>

        </TR>
      </xsl:for-each>
    </TABLE>

  </xsl:template>



</xsl:stylesheet>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to