public class SimpleXMLParser extends Object
| Constructor and Description |
|---|
SimpleXMLParser() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getContentString(Element tag) |
static Document |
getDocument(File file) |
static Document |
getDocument(String filename) |
static Element |
getElement(Element parent,
String tagName) |
static String |
getTagContent(Element parent,
String tagName) |
static String |
getTagContent(Element parent,
String tagName,
String defaultResult) |
public static Document getDocument(String filename) throws XMLException
filename - The file to parseDocument XML tag -- the root of the document.XMLExceptionpublic static Document getDocument(File file) throws XMLException
file - The file to parse.Document XML tag -- the root of the document.XMLExceptionpublic static Element getElement(Element parent, String tagName) throws XMLException
parent - The node containing the desired element tagtagName - The name of the tagXMLExceptionpublic static String getContentString(Element tag) throws XMLException
tag - (start) tag that encloses desired text.XMLException - If the tag has no children.public static String getTagContent(Element parent, String tagName) throws XMLException
parent - A node containing the tag enclosing desired text.tagName - Name of tag containing desired text.XMLExceptionCopyright © 2017. All rights reserved.