public final class XmlUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static Iterable<Element> |
iterableChildElementsByTagName(Element element,
String childTagName)
Iterates the children of the given element,
returning only returning child elements of the given name.
|
static Iterable<Element> |
iterableElements(NodeList nodeList)
Iterates over a NodeList, only returning Elements.
|
static Iterable<Node> |
iterableNodes(NodeList nodeList)
Iterates over a NodeList.
|
static Document |
parseXml(InputStream in)
Parses an XML DOM from an input stream.
|
static Document |
parseXml(URL url)
Fetches and parses an XML DOM from a URL.
|
static String |
toString(Document document) |
public static Document parseXml(URL url) throws IOException, ParserConfigurationException, SAXException
public static Document parseXml(InputStream in) throws IOException, ParserConfigurationException, SAXException
public static Iterable<Node> iterableNodes(NodeList nodeList)
public static Iterable<Element> iterableElements(NodeList nodeList)
public static Iterable<Element> iterableChildElementsByTagName(Element element, String childTagName)
public static String toString(Document document) throws TransformerConfigurationException, TransformerException
Copyright © 2016. All rights reserved.