public final class XmlUtil extends java.lang.Object
This uses JDOM2 as its backing implementation.
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
extractTextFromDocument(org.jdom2.Document doc)
Renders all the text() nodes from the DOM tree.
|
static org.jdom2.Element |
getXPathElement(org.jdom2.Element base,
java.lang.String expression) |
static java.util.List<org.jdom2.Element> |
parse(java.io.InputStream xmlStream,
java.lang.String requestedNodes)
Parses the given stream and returns the requested nodes.
|
static java.util.List<org.jdom2.Element> |
parse(java.lang.String xml,
java.lang.String requestedNodes)
Parses the given XML file and returns the requested nodes.
|
public static java.util.List<org.jdom2.Element> parse(java.lang.String xml, java.lang.String requestedNodes)
xml - file to parse; matches all resources from classpath, filters repeated items.requestedNodes - requested nodes on the xml filepublic static java.util.List<org.jdom2.Element> parse(java.io.InputStream xmlStream, java.lang.String requestedNodes)
xmlStream - stream to parse.requestedNodes - requestd nodes on the xml stream.public static java.lang.String extractTextFromDocument(org.jdom2.Document doc)
doc - Dom treepublic static org.jdom2.Element getXPathElement(org.jdom2.Element base, java.lang.String expression)
Copyright (c) 2001-2022 The Apache Software Foundation. All rights reserved.