Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 21st, 2007, 04:25 AM
Authorized User
 
Join Date: Feb 2007
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to SOMANATHAN10
Default HELP REQD IN PASSING A VALUE IN JAVA PROG TO XSL

I am trying to pass an value from java program to xsl stylesheet.
My code snippet is something like this:

 StreamSource stylesheet = new StreamSource(f);
 Transformer transformer = factory.newTransformer(stylesheet);
transformer.setParameter("param",new Integer(10));

The parameter which is set is not available in the stylesheet.Any help on this will be appreciated.

C.SOMA
__________________
C.SOMA
 
Old June 21st, 2007, 05:35 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Nothing obviously wrong with this code. What does the code in the stylesheet look like, what's your evidence that the value isn't available? What product are you using? (The JAXP specification doesn't actually say what classes of object can be passed to the second arg of setParameter(). I would expect most implementations to accept an Integer, but you need to check the product specifications to be sure).

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
Code download of Prof. Java server prog. J2EE Edi vangalajm J2EE 3 March 2nd, 2012 11:38 PM
Passing parameters to XSL shahbhat XSLT 4 August 27th, 2008 11:08 AM
passing parameters from one xsl to another smys123 XSLT 4 June 21st, 2007 01:23 PM
code of professional java server prog j2ee missing GG Wrox Book Feedback 7 October 11th, 2005 04:50 AM
Souce sode for book PROFFESSIONAL Java Server Prog albenaiz All Other Wrox Books 1 December 14th, 2004 04:18 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.