wood burning stoves*
The moose likes XML and Related Technologies and the fly likes Create many XML-Outputs 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 » Engineering » XML and Related Technologies
Bookmark "Create many XML-Outputs with one XSL-file" Watch "Create many XML-Outputs with one XSL-file" New topic
Author

Create many XML-Outputs with one XSL-file

Robert Jaeger
Ranch Hand

Joined: Apr 29, 2002
Posts: 62
I allways used XSLT to create one output file (XML, PDF, HTML, ...) out of one source file (source.xml).
I would like to know if it is possible to create more output files out of one source file with one xslt-file.
Which function/class/... do I have to use in a servlet? (Until now I allways used Cocoon.)
I also thought about programming a servlet that parses (with JDOM) a XML file and generates many output XML-files (the servlet is a substitute for my XSLT-file), but I think this is not the best method (performance, complexity).
Hopefully somebody can help me,
greetings, Robert.
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
For XSLT 1.0 compatible stylesheets Saxon, Xalan and xt do offer a proprietary extension tag which is placed somewhere in between a template and lets you output multiple files out of one XSL Stylesheet. This looks something like this for Saxon
.
And like this for Xalan
,
and for xt it is
.
All this workarounds have an end in XSLT 1.1 where there is a new standard <xsl:document/> element. Check out the following link to read what the W3C Spec tells about it:
http://www.w3.org/TR/xslt11/#multiple-output
As far as I know Saxon supports this new feature since Saxon version 7.0.
Hope this will help you.
Regards
Berny
(Map disabled smiles)
[ July 12, 2002: Message edited by: Mapraputa Is ]
Robert Jaeger
Ranch Hand

Joined: Apr 29, 2002
Posts: 62
Thanks for your help!
That will help me.
Robert.
 
Consider Paul's rocket mass heater.
 
subject: Create many XML-Outputs with one XSL-file
 
Similar Threads
XML Transform
How can we convert an xml file to create java file
generate xslt
One xml file with multiple xslt
using .xml and .xsl file in Servlets/jsp files to generate .html content (to browser)