public class XMLUtils
extends java.lang.Object
| Constructor and Description |
|---|
XMLUtils() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
getElementAttribute(org.w3c.dom.Element dataRoot,
java.lang.String name,
java.lang.String attr) |
static java.util.List<org.w3c.dom.Element> |
getElementList(org.w3c.dom.Element dataRoot,
java.lang.String name) |
static java.lang.String |
getElementValue(org.w3c.dom.Element dataRoot,
java.lang.String name) |
static java.util.List<java.lang.String[]> |
getElementValueArrayList(org.w3c.dom.Element rootElement,
java.lang.String subElementName,
java.lang.String... fieldsName)
root/subElement[]/field1, field2, fieldN
|
static java.util.List<java.lang.String> |
getElementValueList(org.w3c.dom.Element rootElement,
java.lang.String subElementName) |
static org.w3c.dom.Element |
getSingleElement(org.w3c.dom.Element dataRoot,
java.lang.String name)
Return the first element child with the specified name
|
public static java.util.List<org.w3c.dom.Element> getElementList(org.w3c.dom.Element dataRoot,
java.lang.String name)
rootElement - the starting nodesubElementName - the name of the subelement to findpublic static java.lang.String getElementAttribute(org.w3c.dom.Element dataRoot,
java.lang.String name,
java.lang.String attr)
dataRoot - the starting nodename - the name of the sub elementattr - the attribute to getpublic static java.lang.String getElementValue(org.w3c.dom.Element dataRoot,
java.lang.String name)
dataRoot - the starting nodename - the name of the sub elementpublic static org.w3c.dom.Element getSingleElement(org.w3c.dom.Element dataRoot,
java.lang.String name)
dataRoot - the starting nodename - the name of sub element to look forpublic static java.util.List<java.lang.String> getElementValueList(org.w3c.dom.Element rootElement,
java.lang.String subElementName)
rootElement - the starting nodesubElementName - the name of the subelement to findpublic static java.util.List<java.lang.String[]> getElementValueArrayList(org.w3c.dom.Element rootElement,
java.lang.String subElementName,
java.lang.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 © 2018 DuraSpace. All Rights Reserved.