Hello,
I have the use case that I need to stream an xml document after the sax
transformation with httpclient's post.setRequestEntity method.
The sax tranformstation looks like this:
PrintWriter out = response.getWriter();
StreamResult streamResult = new StreamResult(out);
SAXTransformerFactory tf = (SAXTransformerFactory)
SAXTransformerFactory.newInstance();
TransformerHandler hd = tf.newTransformerHandler();
Transformer serializer = hd.getTransformer();
serializer.setOutputProperty(OutputKeys.ENCODING, "ISO-8859-1");
serializer.setOutputProperty(OutputKeys.INDENT, "yes");
hd.setResult(streamResult);
AttributesImpl atts = new AttributesImpl();
hd.startDocument();
hd.startElement("", "", "Document", atts);
hd.characters("Hello Document".toCharArray(), 0, "Hello Document".length());
atts.clear();
hd.endElement("", "", "Document");
hd.endDocument();
Then I need to insert it to the post method:
post.setRequestEntity(new InputStreamRequestEntity(
new FileInputStream(input), input.length()));
How can I do this?
Cheers,
Pete
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]