File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes Passing Parameters to XSLT ? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Reply Bookmark "Passing Parameters to XSLT ?" Watch "Passing Parameters to XSLT ?" New topic
Author

Passing Parameters to XSLT ?

Arsalan
Greenhorn

Joined: Jul 05, 2001
Posts: 1
Basically I wanted to control the display of records say 10 records each time using Next and Previous Links/Buttons -
If I wanted to Pass the Parameters say M and N to XSLT so that It can transform those M and N Position records how can I pass the parameters outside xslt ?
I've this code that does the transformation:
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer = tFactory.newTransformer(new StreamSource("file:///ManageAnywhere/CommInterface.xsl"));
response.setContentType( "text/html" );
PrintWriter out = new PrintWriter( new BufferedWriter( response.getWriter() ) );
transformer.transform( new StreamSource(new StringReader(appEesm.process("DAJAMES"))), new StreamResult(out));
out.flush();
out.close();
any Idea
arsalan
Mapraputa Is
Leverager of our synergies
Sheriff

Joined: Aug 26, 2000
Posts: 10065
How do you pass a parameter depends on XSLT processor you use. Xalan, for example, provides Transformer�s setParameter(String name, Object value) method.
Also, Arsalan, unfortunately your name doesn�t comply with our official policy on registered names. Please, use both your first and last name. We are glad to see you here, just a formality.
[This message has been edited by Mapraputa Is (edited July 05, 2001).]


Uncontrolled vocabularies
"I try my best to make *all* my posts nice, even when I feel upset" -- Philippe Maquet
Arsalan Lodhi
Greenhorn

Joined: Jul 05, 2001
Posts: 4
Alright - sorryy about that - I didnt notice that pilicy although its mentioned in very bld and large letters :-) -
 
 
subject: Passing Parameters to XSLT ?
 
Threads others viewed
Servlet, XML response and XSL
Facing org .apache .xml. dtm. DTMException Not supported
XML Transformation error
Using FOP
Out of memory when using transform function on huge xml
IntelliJ Java IDE

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture