Hi Miroslav,

Here's an example:

...
StreamSource styleSheet = ...;
StreamSource input = ...;
StreamResult result = ...;

Transformer serializer = null;

serializer = tfactory.newTransformer(styleSheet);
serializer.setParameter("PARAM_NAME","value");
serializer.transform(input, result);
...

You can refer to the parameter "PARAM_NAME" in your XSLT
as follows:

<xsl:stylesheet ...>
  <xsl:param name="PARAM_NAME"/>

  <xsl:template ...>
     <xsl:value-of select="$PARAM_NAME"/>
  </xsl:template>
</xsl:stylesheet>

Regards,
-John K


Miroslav Nachev wrote:

Hi!
Can anybody tell me an easy way of passing an external parameter
(an object or a value) from a Java object to a XSL stylesheet, that
will be visible during transformation.
The only way I find is by using an external function, but for some
reasons it is not convenient for me.


   Thanks.
   Miro







Reply via email to