Package info.freelibrary.util
Class XmlUtils
- java.lang.Object
-
- info.freelibrary.util.XmlUtils
-
public final class XmlUtils extends Object
Utilities for working with XML.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
format(String aUnformattedXmlString)
Pretty prints the supplied XML string using a default indentation of two spaces.static String
format(String aUnformattedXmlString, int aIndentation)
Pretty prints the supplied XML string using a supplied indentation.
-
-
-
Method Detail
-
format
public static String format(String aUnformattedXmlString, int aIndentation) throws TransformerConfigurationException, TransformerException
Pretty prints the supplied XML string using a supplied indentation.- Parameters:
aUnformattedXmlString
- An unformatted XML stringaIndentation
- An indentation count- Returns:
- A pretty printed XML string
- Throws:
TransformerConfigurationException
- If there is trouble configuring the JDK XML transformerTransformerException
- If there is trouble transforming the supplied XML
-
format
public static String format(String aUnformattedXmlString) throws TransformerConfigurationException, TransformerException
Pretty prints the supplied XML string using a default indentation of two spaces.- Parameters:
aUnformattedXmlString
- An unformatted XML string- Returns:
- A pretty printed XML string
- Throws:
TransformerConfigurationException
- If there is trouble configuring the JDK XML transformerTransformerException
- If there is trouble transforming the supplied XML
-
-