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 April 4th, 2007, 12:45 PM
Authorized User
 
Join Date: Nov 2006
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default Using XSLT and JAVA

I have generated XSLT script that takes various xml file as input and generates a new xml file. It is basically mapping between the xml files.
Now, I want to embed some JAVA code to this xslt so that I can deploy it to execute on any machine as well I am able to provide the input files at run time.
Can any one suggest me as to how can I so this and whether is this actually possible.
I will appreciate your help
Thanks!!
Aditi

 
Old April 4th, 2007, 02:00 PM
Registered User
 
Join Date: Apr 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm not sure I understand the question. Do you want to call a java function from within your XSLT? or do you want to run your XSLT through Java using org.apache.xalan.xslt.Process?


 
Old April 4th, 2007, 02:08 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Take a look at the JAXP API (package javax.xml.transform). This provides methods that allow you to run an XSLT transformation from a Java application. It works with all the main Java XSLT processors including Saxon, Xalan, Oracle.



Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old April 4th, 2007, 02:09 PM
Authorized User
 
Join Date: Nov 2006
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanx for responding !!

I want to run XSLT through JAVA and want to supply the input file names during runtime. I have no idea how to do this.
I will really appreciate if you could help me with this.
Thanx
Aditi

 
Old April 4th, 2007, 02:13 PM
Authorized User
 
Join Date: Nov 2006
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for your reply!!
I will try package javax.xml.transform !!

Thanks!






Similar Threads
Thread Thread Starter Forum Replies Last Post
XSLT and JAVA bonekrusher XSLT 3 August 9th, 2006 07:38 PM
XSLT 2.0 Transformation and JAVA markus2000 XML 2 June 22nd, 2006 04:34 AM
XSLT with Java Hind XSLT 1 May 24th, 2006 04:18 AM
Java & XSLT safin XSLT 0 September 8th, 2005 01:11 PM
binding java from xslt mountainbiker XSLT 2 February 19th, 2004 11:53 AM





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