|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnl.knmi.orfeus.seedlink.XMLParser
public class XMLParser
Method Summary | |
---|---|
static java.lang.String |
documentToString(Document document)
Parses SeedLink XML into a String. |
static java.lang.String |
elementToString(Element element)
Parses SeedLink XML Element into a String. |
static Document |
parse(java.lang.String xml)
Parses SeedLink XML into a org.dom4j.Document object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Document parse(java.lang.String xml) throws DocumentException
xml
- XML source returned by a SeedLink INFO request.
Example usage:
infoLevel = slconn.getInfoString(); // print raw XML // System.out.println(infoLevel); if (infoLevel == null) throw (new DatabaseException("ERROR: Invalid INFO response")); // parse XML to String Document document = XMLParser.parse(infoLevel); // print doc contents in readable format System.out.println(XMLParser.documentToString(document)); // do something with document...
DocumentException
- on error reading XML into DocumentSLClient.packetHandler(int, SLPacket)
,
SeedLinkConnection.getInfoString()
public static java.lang.String documentToString(Document document) throws DocumentException
document
- a org.dom4j.Document object containing SeedLink XML .
DocumentException
public static java.lang.String elementToString(Element element) throws DocumentException
element
- a org.dom4j.Element object containing SeedLink XML .
DocumentException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |