public class XMLUtils extends Object
| Constructor and Description |
|---|
XMLUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getElementAttribute(Element dataRoot,
String name,
String attr) |
static List<Element> |
getElementList(Element dataRoot,
String name) |
static String |
getElementValue(Element dataRoot,
String name) |
static List<String[]> |
getElementValueArrayList(Element rootElement,
String subElementName,
String... fieldsName)
root/subElement[]/field1, field2, fieldN
|
static List<String> |
getElementValueList(Element rootElement,
String subElementName) |
static Element |
getSingleElement(Element dataRoot,
String name)
Return the first element child with the specified name
|
public static List<Element> getElementList(Element dataRoot, String name)
dataRoot - the starting nodename - the name of the subelement to findpublic static String getElementAttribute(Element dataRoot, String name, String attr)
dataRoot - the starting nodename - the name of the sub elementattr - the attribute to getpublic static String getElementValue(Element dataRoot, String name)
dataRoot - the starting nodename - the name of the sub elementpublic static Element getSingleElement(Element dataRoot, String name)
dataRoot - the starting nodename - the name of sub element to look forpublic static List<String> getElementValueList(Element rootElement, String subElementName)
rootElement - the starting nodesubElementName - the name of the subelement to findpublic static List<String[]> getElementValueArrayList(Element rootElement, String subElementName, String... fieldsName)
rootElement - the starting nodesubElementName - the name of the sub element to work onfieldsName - the names of the sub-sub-elements from which get the text
contentCopyright © 2022 LYRASIS. All rights reserved.