NULL_STRING, TAG_WILDCARD, XML_HEADER
Constructor and Description |
---|
XmlUtil() |
Modifier and Type | Method and Description |
---|---|
static List<String> |
findDescendantNamesWithSeparator(Node parent,
String tag,
String separator)
Find all of the descendant elements of the given parent Node whose tag
name equals the given tag.
|
private static void |
findDescendantNamesWithSeparator(Node parent,
String tag,
String descendants,
String separator,
List<String> found)
Find all of the descendant elements of the given parent Node whose
tag name equals the given tag.
|
static Element |
getElementAtNamedPath(Node parent,
List<String> nameList)
Find the element described by nameList (path).
|
static Element |
getMakeElementAtNamedPath(Node parent,
List<String> nameList,
String tagName,
boolean makeNew)
Find the element described by nameList (path).
|
static Element |
makeElementAtNamedPath(Node parent,
List<String> nameList,
String tagName)
Make the element described by nameList (path).
|
static void |
printNode(Node parent)
Print all the attributes of the given node
|
static String |
stripNonValidXMLCharacters(String in)
This method ensures that the output String has only valid XML unicode
characters as specified by the XML 1.0 standard.
|
addChildren, appendCdata, appendCdataBytes, attr, attr, attrs, attrs, attrs, attrs, attrs, calculateRFC2104HMAC, closeTag, comment, create, create, create, create, create, create, create, create, create, create, create, create, createCDataNode, decodeBase64, encodeBase64, encodeString, ensureAttributes, findAncestor, findChild, findChildRecurseUp, findChildren, findChildrenRecurseUp, findDescendant, findDescendantFromPath, findDescendants, findDescendantsFromPath, findElement, findElement, findRoot, findUrlRefNode, findUrlRefNode, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttributeFromTree, getAttributeFromTree, getAttributeFromTree, getAttributeFromTree, getAttributesFromTree, getAttributesFromTree, getCdata, getChildText, getDocument, getDocument, getDocument, getElement, getElements, getElements, getElements, getFirstChild, getGrandChildren, getGrandChildText, getGrandChildText, getGrandChildValue, getHeader, getListOfElements, getLocalName, getNodeName, getRoot, getRoot, getRoot, hasAttribute, isFullyQualified, isTag, main, makeCDataNode, makeCDataNode, makeDocument, mergeAttributes, openTag, openTag, quote, removeChildren, setAttribute, setAttributes, tag, tag, toHtml, toString, toString, toString, toString, toString, toStringNoChildren, toStringWithHeader, toStringWithHeader, toStringWithHeader
public XmlUtil()
public static void printNode(Node parent)
parent
- Node whose attributes will be printed.public static List<String> findDescendantNamesWithSeparator(Node parent, String tag, String separator)
parent
- Root of the XML DOM tree to search.tag
- Tag name to match.separator
- String that separates tags into components.private static void findDescendantNamesWithSeparator(Node parent, String tag, String descendants, String separator, List<String> found)
parent
- Root of the XML DOM tree to search.tag
- Tag name to match.descendants
- Descendant elements.separator
- String separating tag components (also in descendants).found
- List of descendants that match the given tag.public static Element getElementAtNamedPath(Node parent, List<String> nameList)
parent
- Node at which the search should begin.nameList
- List of node names to search for (think xpath).Element
described by the given path, or null
if
there was a problem.public static Element makeElementAtNamedPath(Node parent, List<String> nameList, String tagName)
parent
- Node at which the search should begin.nameList
- List of node names to search for (think xpath).tagName
- Tag name to locate.Element
described by the given path, or null
if
there was a problem.public static Element getMakeElementAtNamedPath(Node parent, List<String> nameList, String tagName, boolean makeNew)
parent
- Node at which the search should begin.nameList
- List of node names to search for (think xpath).tagName
- Tag name to locate.makeNew
- Whether or not a new Element
should be created.Element
described by the given path, or null
if
there was a problem.public static String stripNonValidXMLCharacters(String in)
For reference, please see the standard. This method will return an empty String if the input is null or empty.
in
- String whose non-valid characters we want to remove.