Sto cercando di realizzare uno stylesheet che possa essere dinamicamente
ordinato (sort).
Il frammento di codice del file xsl è:
<xsl:param name="sortBy">L OTTO</xsl:param>
<xsl:param name="sortType" select="ascendi ng"> </xsl:param>
........
<xsl:for-each select="DATAPRE VAPPR_INT">
<xsl:sort select="node()[ name() = $sortBy] "
order="ascendin g" />
<tr>
<td>
<xsl:value-of select="LOTTO"/>
</td>
.....
La parte di codice della servlet che si occupa della trasformazione è:
String xslName = "/WEB-INF/xsl/DatePrevistaApp rSQL.xsl";
try
{
URL stylesheetURL = getServletConte xt().getResourc e(xslName);
ByteArrayOutput Stream baosHTML = new ByteArrayOutput Stream();
TransformerFact ory tFactory = TransformerFact ory.newInstance ();
TransformerFact ory tFactory2 = TransformerFact ory.newInstance ();
Transformer transformer =
tFactory.newTra nsformer(new StreamSource(st ylesheetURL.toS tring()));
*************** *****cambio il parametro
transformer.set Parameter("sort By","DESCRIZION E");
transformer.tra nsform (
new StreamSource(ne w StringReader(xm l)),
new StreamResult(ba osHTML));
Il risultato non cambia!!!
Qualcuno può aiutarmi ???
Grazie.
Alessandro
--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
ordinato (sort).
Il frammento di codice del file xsl è:
<xsl:param name="sortBy">L OTTO</xsl:param>
<xsl:param name="sortType" select="ascendi ng"> </xsl:param>
........
<xsl:for-each select="DATAPRE VAPPR_INT">
<xsl:sort select="node()[ name() = $sortBy] "
order="ascendin g" />
<tr>
<td>
<xsl:value-of select="LOTTO"/>
</td>
.....
La parte di codice della servlet che si occupa della trasformazione è:
String xslName = "/WEB-INF/xsl/DatePrevistaApp rSQL.xsl";
try
{
URL stylesheetURL = getServletConte xt().getResourc e(xslName);
ByteArrayOutput Stream baosHTML = new ByteArrayOutput Stream();
TransformerFact ory tFactory = TransformerFact ory.newInstance ();
TransformerFact ory tFactory2 = TransformerFact ory.newInstance ();
Transformer transformer =
tFactory.newTra nsformer(new StreamSource(st ylesheetURL.toS tring()));
*************** *****cambio il parametro
transformer.set Parameter("sort By","DESCRIZION E");
transformer.tra nsform (
new StreamSource(ne w StringReader(xm l)),
new StreamResult(ba osHTML));
Il risultato non cambia!!!
Qualcuno può aiutarmi ???
Grazie.
Alessandro
--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG