public abstract class XmlUtil extends Object
Modifier and Type | Field and Description |
---|---|
static String |
COMMENT |
static String |
COMMENT_FULL |
Modifier and Type | Method and Description |
---|---|
static void |
removeTextNodes(Element element)
Recursively removes all text nodes from a DOM element.
|
static void |
saveHumanReadable(Document document,
File file)
Saves a DOM to a human-readable XML file (4-space indentation, UTF-8).
|
public static final String COMMENT
public static final String COMMENT_FULL
public static void saveHumanReadable(Document document, File file) throws TransformerFactoryConfigurationError, TransformerException, IOException
Contains workaround for various JVM bugs.
document
- The DOMfile
- The target XML fileTransformerFactoryConfigurationError
- In case of an XML transformation factory configuration errorTransformerException
- In case of an XML transformation errorIOException
- In case of an I/O errorpublic static void removeTextNodes(Element element)
element
- The elementCopyright © 2011-2016 Three Crickets LLC.