public class XMLUtil extends Object
Constructor and Description |
---|
XMLUtil() |
Modifier and Type | Method and Description |
---|---|
static Element |
getOnlyChildElement(NodeList list)
Returns the only child element in a given NodeList.
|
static String |
getOnlyTextContent(NodeList list)
Returns the text node from a given NodeList.
|
static boolean |
hasChildElement(NodeList list)
Checks if the given
NodeList contains a child element. |
static XmlElement |
makeXmlTag(String type,
String content)
Creates an xml tag with a given type and content.
|
public static Element getOnlyChildElement(NodeList list) throws XMLRPCException
list
- A NodeList of children nodes.XMLRPCException
- Will be thrown if there is more then one child element
except empty text nodes.public static String getOnlyTextContent(NodeList list) throws XMLRPCException
list
- The given list of nodes.XMLRPCException
- Will be thrown if there is more than just one
text node within the list.public static boolean hasChildElement(NodeList list)
NodeList
contains a child element.public static XmlElement makeXmlTag(String type, String content)
type
- The type of the xml tag. What will be filled in the <..>.content
- The content of the tag.Copyright © 2016. All rights reserved.