<br><font size=2 face="sans-serif">I have a java program that runs an XSLT program against some XML and outputs the resulting XML to file using the XMLOutputter. See below.</font>
<br>
<ol>
<li value=1><font size=2 face="sans-serif"> FileOutputStream fileOS = null;</font>
<li value=2><font size=2 face="sans-serif"> File outFile = new File(fName);</font>
<li value=3><font size=2 face="sans-serif"> fileOS = new FileOutputStream(outFile);</font>
<li value=4><font size=2 face="sans-serif"> </font>
<li value=5><font size=2 face="sans-serif"> StringBufferInputStream docStream = new StringBufferInputStream(outXML);</font>
<li value=6><font size=2 face="sans-serif"> </font>
<li value=7><font size=2 face="sans-serif"> SAXBuilder builder = new SAXBuilder();</font>
<li value=8><font size=2 face="sans-serif"> Document doc = builder.build(docStream);</font>
<li value=9><font size=2 face="sans-serif"> </font>
<li value=10><font size=2 face="sans-serif"> Transformer transformer = TransformerFactory.newInstance()</font>
<li value=11><font size=2 face="sans-serif"> .newTransformer(new StreamSource(FilePaths.MAN_XML_PATH + strTransformProg));</font>
<li value=12><font size=2 face="sans-serif"> </font>
<li value=13><font size=2 face="sans-serif"> JDOMSource source = new JDOMSource(doc);</font>
<li value=14><font size=2 face="sans-serif"> JDOMResult result = new JDOMResult();</font>
<li value=15><font size=2 face="sans-serif"> </font>
<li value=16><font size=2 face="sans-serif"> transformer.transform(source, result);</font>
<li value=17><font size=2 face="sans-serif"> Document doc2 = result.getDocument();</font>
<li value=18><font size=2 face="sans-serif"> </font>
<li value=19><font size=2 face="sans-serif"> XMLOutputter outp = new XMLOutputter();</font>
<li value=20><font size=2 face="sans-serif"> outp.setTextNormalize(true);</font>
<li value=21><font size=2 face="sans-serif"> outp.setIndent(" ");</font>
<li value=22><font size=2 face="sans-serif"> outp.setNewlines(true);</font>
<li value=23><font size=2 face="sans-serif"> outp.output(doc2, fileOS);</font>
<li value=24><font size=2 face="sans-serif"> </font>
<li value=25><font size=2 face="sans-serif"> fileOS.close();</font>
<li value=26>
<br>
<br><font size=2 face="sans-serif">What I also want is the XSL to generate multiple output files also by doing the following:</font>
<br></ol>
<ol>
<li value=1><font size=2 face="sans-serif"><xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.1"></font>
<li value=2><font size=2 face="sans-serif"> <xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/></font>
<li value=3><font size=2 face="sans-serif"> <xsl:strip-space elements="*"/></font>
<li value=4><font size=2 face="sans-serif"> <!-- ROOT LEVEL OF THE FILE HIERARCHY --></font>
<li value=5><font size=2 face="sans-serif"> <xsl:template match="APP_FILE"></font>
<li value=6><font size=2 face="sans-serif"> <xsl:element name="My-XML"></font>
<li value=7><font size=2 face="sans-serif"> <xsl:document href="my_try.html" method="html"></font>
<li value=8><font size=2 face="sans-serif"> <html><body></body></html></font>
<li value=9><font size=2 face="sans-serif"> </xsl:document></font>
<li value=10><font size=2 face="sans-serif"> </xsl:element></font>
<li value=11><font size=2 face="sans-serif"> </xsl:template></font>
<li value=12><font size=2 face="sans-serif"></xsl:transform></font>
<br>
<br><font size=2 face="sans-serif">What happens is that the XML document my_try.html is not generated and the html ends up in the xml document specified by the java XMLOutputter.</font>
<br><font size=2 face="sans-serif">Is it possible to have the xsl also create multiple output files?</font>
<br>
<br><font size=2 face="sans-serif">Thanks</font>
<br><font size=2 face="sans-serif">Mark</font></ol>