mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-16 12:12:06 +01:00
Fixed pretty printing of XML packet. SMACK-42
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2452 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
b6e862c0ee
commit
e42ba10a3d
1 changed files with 6 additions and 0 deletions
|
@ -712,6 +712,12 @@ public class EnhancedDebugger implements SmackDebugger {
|
||||||
try {
|
try {
|
||||||
// Use a Transformer for output
|
// Use a Transformer for output
|
||||||
TransformerFactory tFactory = TransformerFactory.newInstance();
|
TransformerFactory tFactory = TransformerFactory.newInstance();
|
||||||
|
// Surround this setting in a try/catch for compatibility with Java 1.4. This setting is required
|
||||||
|
// for Java 1.5
|
||||||
|
try {
|
||||||
|
tFactory.setAttribute("indent-number", new Integer(2));
|
||||||
|
}
|
||||||
|
catch (IllegalArgumentException e) {}
|
||||||
Transformer transformer = tFactory.newTransformer();
|
Transformer transformer = tFactory.newTransformer();
|
||||||
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
|
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
|
||||||
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
|
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
|
||||||
|
|
Loading…
Reference in a new issue