aspose file tools*
The moose likes XML and Related Technologies and the fly likes One xml file with multiple xslt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "One xml file with multiple xslt" Watch "One xml file with multiple xslt" New topic
Author

One xml file with multiple xslt

David Sundo
Greenhorn

Joined: Nov 13, 2002
Posts: 6
My limitation in my project is that "No Server". In this project, I run the file from the CD Disk. I try to use one xml file with multiple xslt. Would it possible? Reason: the content of one xml file will be used in 30 diferrent pages.
Otherwise I need to create 30 xml files with 30 xslt which is one xml for one xslt file.
Any ideas?
Thanks in advanced! Greatly appreciated for any feedbacks.
Regards,
David Sundo
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Yes, it's possible.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
David Sundo
Greenhorn

Joined: Nov 13, 2002
Posts: 6
Yes Lasse. If it is possible, Can you give me a hint or simple example how to do that? I have thought about this for a while, I still have no clues. I am new in this xslt. Thank you.
-David Sundo
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Ok. I just re-read your post and realized that a web container/application server is apparently out of the question for you (because of the run-from-disk requirement). In that case, you're probably forced to perform the transformation no the client (web browser) and you're forced to refer to the XSL file from within the XML, right? In that case, I'm afraid you'll have to have 30 copies of the XML with a different stylesheet reference in each of them.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12785
    
    5
Perhaps I don't understand the situation, but since you can specify the xsl file in the command line, why can't you have 30 batch files?
See org.apache.xalan.xslt.Process class
Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: One xml file with multiple xslt