Example #1
0
 /**
  * Returns a new Format object that performs whitespace normalization, uses the UTF-8 encoding,
  * doesn't expand empty elements, includes the declaration and encoding, and uses the default
  * entity escape strategy. Tweaks can be made to the returned Format instance without affecting
  * other instances.
  *
  * @return a Format with whitespace normalization
  */
 public static Format getCompactFormat() {
   Format f = new Format();
   f.setTextMode(TextMode.NORMALIZE);
   return f;
 }
Example #2
0
 /**
  * Returns a new Format object that performs whitespace beautification with 2-space indents, uses
  * the UTF-8 encoding, doesn't expand empty elements, includes the declaration and encoding, and
  * uses the default entity escape strategy. Tweaks can be made to the returned Format instance
  * without affecting other instances.
  *
  * @return a Format with whitespace beautification
  */
 public static Format getPrettyFormat() {
   Format f = new Format();
   f.setIndent(STANDARD_INDENT);
   f.setTextMode(TextMode.TRIM);
   return f;
 }