super.setBody(new MessageBody2Write() {
//<?xml-stylesheet type="text/xsl" href="/stylesheets/topic"?>
public void writeTo(WritableByteChannel out) throws IOException {
Model model = JenaUtil.getModelFromGraph(graph);
//TODO deliver other formats
OutputStream outS = Channels.newOutputStream(out);
if (stylesheet != null) {
outS.write(("<?xml-stylesheet type=\"text/xsl\" href=\""+stylesheet+"\"?>\n").getBytes("utf-8"));
}
Writer outW = new OutputStreamWriter(outS, "utf-8");
new Serializer().serialize(model, "", outW);
outW.flush();
//model.write(outS);
outS.close();
}
});
}