October 30th, 2005


30
Oct 05

Setting Transformer properties

So you are going to output an XML Document to a file using this canonical method. But how do you tell the Transformer object how the output should look like?

You use OutputKeys, that’s how.

For example:
transformer.setOutputProperty(OutputKeys.INDENT,"yes");

Share