public class XMLUtil
extends java.lang.Object
| Constructor and Description |
|---|
XMLUtil() |
| Modifier and Type | Method and Description |
|---|---|
static org.w3c.dom.Element |
getOnlyChildElement(org.w3c.dom.NodeList list)
Returns the only child element in a given NodeList.
|
static java.lang.String |
getOnlyTextContent(org.w3c.dom.NodeList list)
Returns the text node from a given NodeList.
|
static boolean |
hasChildElement(org.w3c.dom.NodeList list)
Checks if the given
NodeList contains a child element. |
static XmlElement |
makeXmlTag(java.lang.String type,
java.lang.String content)
Creates an xml tag with a given type and content.
|
public static org.w3c.dom.Element getOnlyChildElement(org.w3c.dom.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 java.lang.String getOnlyTextContent(org.w3c.dom.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(org.w3c.dom.NodeList list)
NodeList contains a child element.list - The NodeList to check.NodeList contains children.public static XmlElement makeXmlTag(java.lang.String type, java.lang.String content)
type - The type of the xml tag. What will be filled in the <..>.content - The content of the tag.