C
cmaksymchuk
Hello everyone. I am new to JiBX and so far really love it. Simple to
use, fast, etc. The problem I am having is that I need the
IMarshallingContext object to marshall the object into a String, not to
a file. How would I go about doing this?
Here is my code:
// ==================================================
IBindingFactory bfact = BindingDirectory.getFactory(JdeRequest.class);
// marshal object back out to file (with nice indentation, as UTF-8)
IMarshallingContext mctx = bfact.createMarshallingContext();
mctx.setIndent(2);
FileOutputStream out = new FileOutputStream("out.xml");
mctx.marshalDocument(jdeRequest, "UTF-8", null, out);
// here is where I would like to get the marshalled document in a local
// string variable
// String s = ?
// ==================================================
Please help
Thanks in advance to you kind people out there that help unfortunate
souls like me
Cheers,
Yeuker
use, fast, etc. The problem I am having is that I need the
IMarshallingContext object to marshall the object into a String, not to
a file. How would I go about doing this?
Here is my code:
// ==================================================
IBindingFactory bfact = BindingDirectory.getFactory(JdeRequest.class);
// marshal object back out to file (with nice indentation, as UTF-8)
IMarshallingContext mctx = bfact.createMarshallingContext();
mctx.setIndent(2);
FileOutputStream out = new FileOutputStream("out.xml");
mctx.marshalDocument(jdeRequest, "UTF-8", null, out);
// here is where I would like to get the marshalled document in a local
// string variable
// String s = ?
// ==================================================
Please help
Thanks in advance to you kind people out there that help unfortunate
souls like me
Cheers,
Yeuker