This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi, I want to pass a runtime parameter to an XSL file through my java code.This parameter value should be set to a global parameter in my XSL file.My XSL should work accordingly depending on this parameter.
Can some one help me to make this XSL file take the global parameter value.
You could put a placeholder (e.g. "@variablename@") into your XSL file and run it through a filter which replaces all @...@ with the corresponding runtime value. You could start by looking into extending javax.xml.transform.stream.StreamSource or java.io.InputStream. Although Xalan's setParameter() is definitely a better alternative if you can trust on using Xalan instead of "some" XSL engine. [ November 06, 2003: Message edited by: Lasse Koskela ]