Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
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

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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

how to interact two xml files with one xsl file

Srinivas Rallapalli

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.
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:
Tiffany Sun

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.

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 exaple no 22 or 23
I agree. Here's the link:
subject: how to interact two xml files with one xsl file
Similar Threads
question on apply-templates
xml / xsl not accessible on netscape & mozilla
Associating 1 XSL file with many XML files
How to incluse a dtd.
handling 2 xml files with one xsl file