public final class DOMUtilities extends Object
Modifier and Type | Method and Description |
---|---|
static String |
getText(Element e)
extracts all text-elements of a particular element and returns an single string containing the contents of all
textelements and all character entity nodes.
|
static Document |
parseInputStream(InputStream instream)
Parses the given input stream to form a document.
|
public static Document parseInputStream(InputStream instream) throws ParserConfigurationException, SAXException, IOException
instream
- the input stream that should be parsed.null
, when an error occuredParserConfigurationException
- if the parser could not be initalized.SAXException
- if the parsing failed due to errors in the xml documentIOException
- if reading from the input stream failed.public static String getText(Element e)
&entityname;
.e
- the element which is direct parent of all to be extracted textnodes.