on 02-22-2008 2:15 PM
hi everybody,
how do I convert a org.w3c.dom.Document into outputStream as needed in JAVA mapping?
Thanks regards
Mario
Hi,
I found a workaround.
Bye, mario
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mario,
even if you already found the solution, I think the information may be useful to others.
You could do something like:
(...)
import org.w3c.dom.Document;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
(...)
Document doc;
(...)
try {
TransformerFactory tf = TransformerFactory.newInstance();
Transformer trans = tf.newTransformer();
trans.transform(new DOMSource(doc), new StreamResult(out));
} catch (TransformerConfigurationException e) {
// Implement exception handling
} catch (TransformerException e) {
// Implement exception handling
}
(...)
Regards,
Henrique.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.