XSL e Sort

Discussion in 'XML' started by Alessandro Benedetti, Dec 22, 2003.

  1. Sto cercando di realizzare uno stylesheet che possa essere dinamicamente
    ordinato (sort).

    Il frammento di codice del file xsl è:

    <xsl:param name="sortBy">LOTTO</xsl:param>
    <xsl:param name="sortType" select="ascending"> </xsl:param>

    ........

    <xsl:for-each select="DATAPREVAPPR_INT">

    <xsl:sort select="node()[ name() = $sortBy] "
    order="ascending" />
    <tr>
    <td>
    <xsl:value-of select="LOTTO"/>
    </td>

    .....

    La parte di codice della servlet che si occupa della trasformazione è:


    String xslName = "/WEB-INF/xsl/DatePrevistaApprSQL.xsl";

    try
    {
    URL stylesheetURL = getServletContext().getResource(xslName);


    ByteArrayOutputStream baosHTML = new ByteArrayOutputStream();

    TransformerFactory tFactory = TransformerFactory.newInstance();
    TransformerFactory tFactory2 = TransformerFactory.newInstance();

    Transformer transformer =
    tFactory.newTransformer(new StreamSource(stylesheetURL.toString()));

    ********************cambio il parametro

    transformer.setParameter("sortBy","DESCRIZIONE");


    transformer.transform (
    new StreamSource(new StringReader(xml)),
    new StreamResult(baosHTML));

    Il risultato non cambia!!!


    Qualcuno può aiutarmi ???

    Grazie.

    Alessandro



    --
    Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
     
    Alessandro Benedetti, Dec 22, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. nobody
    Replies:
    0
    Views:
    557
    nobody
    Jun 1, 2004
  2. Replies:
    1
    Views:
    3,651
    A. Bolmarcich
    May 27, 2005
  3. JerryJ
    Replies:
    11
    Views:
    1,424
    Dave Moore
    Apr 28, 2004
  4. Replies:
    2
    Views:
    9,327
    Martin Honnen
    Sep 5, 2006
  5. Navin
    Replies:
    1
    Views:
    744
    Ken Schaefer
    Sep 9, 2003
Loading...

Share This Page