File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Product and Other Certifications and the fly likes how to interact two xml files with one xsl file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Product and Other Certifications
Bookmark "how to interact two xml files with one xsl file" Watch "how to interact two xml files with one xsl file" New topic
Author

how to interact two xml files with one xsl file

Srinivas Rallapalli
Greenhorn

Joined: May 20, 2003
Posts: 18
Dear All,
I have two xml files. Now the thing is, i have to write an xsl file so that it should search for an element in the first xml file and then that element should be replaced with another element in the second xml file. can anybody solve this problem.
Thanks,
srinivas
Roseanne Zhang
Ranch Hand

Joined: Nov 14, 2000
Posts: 1953
You need to use xslt extention until the next generation of XSLT.
See an example here:
http://bobcat.webappcabaret.net/javachina/faq/xslt_01.htm#xslt_ex_Q01
Tiffany Sun
Greenhorn

Joined: Oct 02, 2001
Posts: 26
You can do this with extra java code.
1. declare an array of string, put the xml file names in it.
2. Write a method to get Document from the two XML files, like Document getDocFromXMLFiles(String [] XMLFileNames).
3. Transform source using the Document and the XSL file.
Tiffany


SCJP, SCWCD, IBM-XML
Steven Broadbent
Ranch Hand

Joined: Dec 10, 2002
Posts: 400
you can use the document function to do this in xsl.
there is a very good example in Sal Manangos XSLT cookbook by O'Reilly


"....bigmouth strikes again, and I've got no right to take my place with the human race...."<p>SCJP 1.4
jawwad ahmed
Ranch Hand

Joined: Dec 01, 2001
Posts: 179
Yes u can find document example from xfront.com exaple no 22 or 23
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to interact two xml files with one xsl file