use of org.apache.xml.serialize.DOMSerializer in project OpenAM by OpenRock.
the class AMEncryptionProvider method toString.
// converts the element to a string.
private String toString(Element doc) {
OutputFormat of = new OutputFormat();
of.setIndenting(true);
of.setMethod(Method.XML);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DOMSerializer serializer = new XMLSerializer(baos, of);
try {
serializer.serialize(doc);
} catch (IOException ioe) {
ioe.printStackTrace();
}
return (baos.toString());
}
use of org.apache.xml.serialize.DOMSerializer in project vcell by virtualcell.
the class DOMUtil method serialize.
public static void serialize(Document document, OutputStream out) throws IOException {
OutputFormat format = new OutputFormat();
XMLSerializer serializer = new XMLSerializer(out, format);
DOMSerializer domSerializer = serializer.asDOMSerializer();
domSerializer.serialize(document);
}
Aggregations