Class XMLUtils
java.lang.Object
org.deltava.util.XMLUtils
- Direct Known Subclasses:
KMLUtils
A utility class for performing XML operations.
- Since:
- 1.0
- Version:
- 11.2
- Author:
- Luke
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
addIfPresent
(Element be, Element e) Adds a child XML document element to an existing element, if it is not nullstatic Element
createElement
(String name, String value) Creates a new XML document element.static Element
createElement
(String name, String value, boolean asCDATA) Creates a new XML document element.static Element
createElement
(String name, String subElementName, String value) Creates a new XML document element, with an embedded child element.static Element
createIfPresent
(String name, String value) Creates a new XML document element if the value is not null or empty.static String
Converts an XML document into text using a specific character set.static String
getChildText
(Element e, String... names) Finds a child element multiple levels down and returns its value.static boolean
hasElement
(Element e, String name) Returns if an XML element contains a child element with a particular name.static void
setChildText
(Element e, String ceName, String value) Updates a child element's text.static String
Removes invalid unicode characters from an XML element.
-
Constructor Details
-
XMLUtils
protected XMLUtils()
-
-
Method Details
-
getChildText
-
createElement
-
createElement
-
createIfPresent
-
createElement
-
hasElement
-
addIfPresent
-
setChildText
-
format
-
stripInvalidUnicode
-