package uk.ac.leeds.ccg.cluster; import java.net.*; import java.util.*; import com.microstar.xml.*; public class Parser implements XmlHandler{ XmlParser parser = new XmlParser(); Vector results = new Vector(); public Vector getResults(){ return results; } public Vector parseXML(URL in){ results = new Vector(); parser.setHandler(this); try { if (in != null) parser.parse(in.toString(), (String) null, (String) null); } catch (Exception e) { e.printStackTrace(); } return results; } public void startDocument () throws java.lang.Exception{ } public void endDocument () throws java.lang.Exception{ } public Object resolveEntity (String publicId, String systemId){ return null; } public void startExternalEntity (String systemId)throws java.lang.Exception { } public void endExternalEntity (String systemId) throws java.lang.Exception{ } public void doctypeDecl (String name, String publicId, String systemId) throws java.lang.Exception{ } public void attribute (String aname, String value, boolean isSpecified) throws java.lang.Exception{ } public void startElement (String elname) throws java.lang.Exception { } public void endElement (String elname) throws java.lang.Exception { } public void charData (char ch[], int start, int length) throws java.lang.Exception { } public void ignorableWhitespace (char ch[], int start, int length) throws java.lang.Exception { } public void processingInstruction (String target, String data)throws java.lang.Exception { } public void error (String message, String systemId, int line, int column)throws java.lang.Exception{ System.out.println("error(message:" + message + ")"); } }