public final class XmlUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
compact(java.lang.String xml)
Compacts an XML text string, by removing CR, LF, TAB and converting double WHITESPACE characters to single.
|
static void |
compact(java.lang.StringBuilder xml)
Compacts an XML string builder, by removing CR, LF, TAB and converting double WHITESPACE characters to single.
|
static java.util.List<org.w3c.dom.Node> |
findAllNodes(org.w3c.dom.Node node,
java.lang.String childNodeName)
Searches for all matching child nodes found under the given Node.
|
static java.util.List<org.w3c.dom.Node> |
findAllNodes(org.w3c.dom.Node node,
java.lang.String childNodeName,
MatchType matchType,
StringComparison comparisonType)
Searches for all matching child nodes found under the given Node.
|
static org.w3c.dom.Node |
findAttribute(org.w3c.dom.Node node,
java.lang.String attributeName)
Searches for the first matching attribute found on the given Node.
|
static org.w3c.dom.Node |
findAttribute(org.w3c.dom.Node node,
java.lang.String attributeName,
MatchType matchType,
StringComparison comparisonType)
Searches for the first matching attribute found on the given Node.
|
static org.w3c.dom.Node |
findNode(org.w3c.dom.Node node,
java.lang.String childNodeName)
Searches for a matching child node found under the given Node.
|
static org.w3c.dom.Node |
findNode(org.w3c.dom.Node node,
java.lang.String childNodeName,
int index)
Searches for a matching child node found under the given Node.
|
static org.w3c.dom.Node |
findNode(org.w3c.dom.Node node,
java.lang.String childNodeName,
int index,
MatchType matchType,
StringComparison comparisonType)
Searches for a matching child node found under the given Node.
|
static java.lang.String |
parseAttribute(org.w3c.dom.Node node,
java.lang.String attributeName)
Parses the first matching attribute found on the given Node.
|
static java.lang.String |
parseAttribute(org.w3c.dom.Node node,
java.lang.String attributeName,
MatchType matchType,
StringComparison comparisonType)
Parses the first matching attribute found on the given Node.
|
static java.lang.String |
parseNode(org.w3c.dom.Node node,
java.lang.String childNodeName)
Parses a child node found on the given Node.
|
static java.lang.String |
parseNode(org.w3c.dom.Node node,
java.lang.String childNodeName,
int index)
Parses a child node found on the given Node.
|
static java.lang.String |
parseNode(org.w3c.dom.Node node,
java.lang.String childNodeName,
int index,
MatchType matchType,
StringComparison comparisonType)
Parses a child node found on the given Node.
|
public static java.lang.String compact(java.lang.String xml)
java.lang.NullPointerException
- An argument is null.public static void compact(java.lang.StringBuilder xml)
java.lang.NullPointerException
- An argument is null.public static org.w3c.dom.Node findAttribute(org.w3c.dom.Node node, java.lang.String attributeName)
java.lang.NullPointerException
- An argument is null.public static org.w3c.dom.Node findAttribute(org.w3c.dom.Node node, java.lang.String attributeName, MatchType matchType, StringComparison comparisonType)
java.lang.NullPointerException
- An argument is null.public static java.lang.String parseAttribute(org.w3c.dom.Node node, java.lang.String attributeName)
java.lang.NullPointerException
- When an argument is null.public static java.lang.String parseAttribute(org.w3c.dom.Node node, java.lang.String attributeName, MatchType matchType, StringComparison comparisonType)
java.lang.NullPointerException
- When an argument is null.public static org.w3c.dom.Node findNode(org.w3c.dom.Node node, java.lang.String childNodeName)
java.lang.NullPointerException
- When an argument is null.public static org.w3c.dom.Node findNode(org.w3c.dom.Node node, java.lang.String childNodeName, int index)
java.lang.NullPointerException
- When an argument is null.public static org.w3c.dom.Node findNode(org.w3c.dom.Node node, java.lang.String childNodeName, int index, MatchType matchType, StringComparison comparisonType)
java.lang.NullPointerException
- When an argument is null.public static java.util.List<org.w3c.dom.Node> findAllNodes(org.w3c.dom.Node node, java.lang.String childNodeName)
java.lang.NullPointerException
- An argument is null.public static java.util.List<org.w3c.dom.Node> findAllNodes(org.w3c.dom.Node node, java.lang.String childNodeName, MatchType matchType, StringComparison comparisonType)
java.lang.NullPointerException
- An argument is null.public static java.lang.String parseNode(org.w3c.dom.Node node, java.lang.String childNodeName)
java.lang.NullPointerException
- When an argument is null.public static java.lang.String parseNode(org.w3c.dom.Node node, java.lang.String childNodeName, int index)
java.lang.NullPointerException
- When an argument is null.public static java.lang.String parseNode(org.w3c.dom.Node node, java.lang.String childNodeName, int index, MatchType matchType, StringComparison comparisonType)
java.lang.NullPointerException
- When an argument is null.