throw new IsisException(e);
}
}
static String asString(final Document doc) {
XMLWriter writer = null;
final StringWriter sw = new StringWriter();
try {
// previously this code used pretty print.
// however, that tripped up on strings with double spaces in them; the double space was normalized
// to a single space!
// OutputFormat outputFormat = OutputFormat.createPrettyPrint();
// writer = new XMLWriter(sw, outputFormat);
writer = new XMLWriter(sw);
writer.write(doc);
return sw.toString();
} catch (IOException e) {
throw new IsisException(e);
} finally {
if(writer != null) {
try {
writer.close();
} catch (IOException e) {
// ignore
}
}
}