avoid Result parameter in transform method 2003-06-16 - By peter peter
I am using xalan2.2.1
I am using <redirect> extension to create multiple output files. I don't want to specify any outputfile name(Result) in the transform method, as i want <redirect> to create multiple output files. I am getting following problems. 1. if I use this, transformer.transform(new DOMSource(doc),new DOMResult() ); I am getting this exception: javax.xml.transform.TransformerException: org.xml.sax.SAXException: Can't have more than one root on a DOM! 2. If i use this, transformerImpl.transform(new DOMSource(doc),new StreamResult() ); I got this exception: javax.xml.transform.TransformerException: No output specified 3. If i use this, transformerImpl.transform(new DOMSource(doc),new StreamResult("dummy.txt") ); then I got the correct results, But I don't want to use this option as it is creating one dummy.txt file which I don't want. I am ready to send my XSL file if anyone is interested. Any help or pointers in this regard, will be appreciated.
Regards, Peter
--------------------------------- Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. <DIV>I am using xalan2.2.1</DIV> <DIV><BR>I am using <redirect> extension to create multiple output files. I don't want to specify any outputfile name(Result) in the transform method, as i want <redirect> to create multiple output files.</DIV> <DIV> </DIV> <DIV>I am getting following problems.</DIV> <DIV>1. if I use this,</DIV> <DIV> transformer.transform(new DOMSource(doc),new DOMResult() );</DIV> <DIV> </DIV> <DIV> I am getting this exception:<BR> javax.xml.transform .TransformerException: org.xml.sax.SAXException: Can't have more than one root on a DOM!</DIV> <DIV>2. If i use this,</DIV> <DIV> transformerImpl.transform(new DOMSource(doc),new StreamResult() );< /DIV> <DIV> </DIV> <DIV> I got this exception:</DIV> <DIV> javax.xml.transform.TransformerException: No output specified</DIV> <DIV> </DIV> <DIV>3. If i use this,</DIV> <DIV> transformerImpl.transform(new DOMSource(doc),new StreamResult("dummy .txt") );</DIV> <DIV> </DIV> <DIV> then I got the correct results, But I don't want to use this option as it is creating one dummy.txt file which I don't want.</DIV> <DIV> </DIV> <DIV>I am ready to send my XSL file if anyone is interested.<BR>Any help or pointers in this regard, will be appreciated.</DIV> <DIV><BR>Regards,</DIV> <DIV>Peter</DIV><p><hr SIZE=1> Do you Yahoo!?<br> <a href="http://us.rd.yahoo.com/search/mailsig/*http://search.yahoo.com">The New Yahoo! Search</a> - Faster. Easier. Bingo.
|
|