public final class Nodes extends Object
Modifier and Type | Method and Description |
---|---|
static Map<QName,String> |
getAttributes(Node n)
Obtains an element's attributes as Map.
|
static String |
getMergedNestedText(Node n)
Tries to merge all direct Text and CDATA children of the given
Node and concatenates their value.
|
static QName |
getQName(Node n)
Extracts a Node's name, namespace URI (if any) and prefix as a
QName.
|
static Node |
normalizeWhitespace(Node original)
Creates a new Node (of the same type as the original node) that
is similar to the orginal but doesn't contain any empty text or
CDATA nodes and where all textual content including attribute
values or comments are trimmed and normalized.
|
static Node |
stripWhitespace(Node original)
Creates a new Node (of the same type as the original node) that
is similar to the orginal but doesn't contain any empty text or
CDATA nodes and where all textual content including attribute
values or comments are trimmed.
|
public static QName getQName(Node n)
public static String getMergedNestedText(Node n)
public static Map<QName,String> getAttributes(Node n)
public static Node stripWhitespace(Node original)
public static Node normalizeWhitespace(Node original)
"normalized" in this context means all whitespace characters are replaced by space characters and consecutive whitespace characaters are collapsed.
Copyright © 2001–2017 XMLUnit. All rights reserved.