我假设您正在使用a
Transformer进行实际的编写(至
StreamResult)。在这种情况下,请在致电之前执行此操作
transform:
transformer.setOutputProperty(OutputKeys.INDENT, "yes");transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
我假设您正在使用a
Transformer进行实际的编写(至
StreamResult)。在这种情况下,请在致电之前执行此操作
transform:
transformer.setOutputProperty(OutputKeys.INDENT, "yes");transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");