A
Alessandro Benedetti
Sto cercando di realizzare uno stylesheet che possa essere dinamicamente
ordinato (sort).
Il frammento di codice del file xsl è:
<xsl
aram name="sortBy">LOTTO</xsl
aram>
<xsl
aram name="sortType" select="ascending"> </xsl
aram>
........
<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
ordinato (sort).
Il frammento di codice del file xsl è:
<xsl
<xsl
........
<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