Support for XML Document 2 Java String

Hi There,

I couldnt’ find anywhere in the TaminoAPI4J, the java String representation of XML Document, like the one provided in the HTTP API.

Any help in this regard. Actaully, i want to convert TXMLObject contents, with the ObjectModel being DOM to a Java String. Does the API provide this feature.

Anyways, in a more generic form independent of the ObjectModels, one should be able to represent the TXMlObject contents as String

Thanks in Advance

An XML document is represented by the TXMLObject object. This implements the TStreamable interface which has a writeTo() method. So you could do something like:

TXMLObject xmlobj = …

StringWriter sw = new StringWriter();
xmlobj.writeTo (sw);
String strxml = sw.getBuffer().toString();