public class XmlUtils extends Object
Modifier and Type | Method and Description |
---|---|
static Element |
getChild(Node parent)
Returns the single element child of a DOM node.
|
static Element |
getChild(Node parent,
String tagName)
Returns the single child element of a DOM node, which has a given
known name.
|
static Element[] |
getChildren(Node parent)
Returns an array of all the Element children of a DOM node.
|
static String |
getTextContent(Element el)
Returns the text content of an element as a string.
|
static Object |
parseSampValue(Element valueEl)
Returns the content of a DOM element representing a
value
element of an XML-RPC document. |
public static Element[] getChildren(Node parent)
parent
- parent nodepublic static Element getChild(Node parent) throws org.astrogrid.samp.xmlrpc.internal.XmlRpcFormatException
parent
- parent nodeXmlRpcFormatException
- if there is not exactly one child
per elementpublic static Element getChild(Node parent, String tagName) throws org.astrogrid.samp.xmlrpc.internal.XmlRpcFormatException
parent
- parent nodetagName
- child node nametagName
XmlRpcFormatException
- if there is not exactly one child
element or if it does not have name tagName
public static String getTextContent(Element el) throws org.astrogrid.samp.xmlrpc.internal.XmlRpcFormatException
el
- parent nodeXmlRpcFormatException
- if content is not just textpublic static Object parseSampValue(Element valueEl) throws org.astrogrid.samp.xmlrpc.internal.XmlRpcFormatException
value
element of an XML-RPC document.
Note that some content which would be legal in XML-RPC, but is not
legal in SAMP, may result in an exception.valueEl
- value elementorg.astrogrid.samp.xmlrpc.internal.XmlRpcFormatException
Copyright © 2008–2024. All rights reserved.