Mercurial > hg > Members > nobuyasu > TestNeo4j
changeset 15:fa38ded4c054 draft
fix TestSaxParser.java
author | one |
---|---|
date | Thu, 23 Aug 2012 09:01:52 +0900 |
parents | 1405a0c97c67 |
children | 5c8c554ee3ac |
files | src/howtouse/TestSaxParser.java |
diffstat | 1 files changed, 0 insertions(+), 34 deletions(-) [+] |
line wrap: on
line diff
--- a/src/howtouse/TestSaxParser.java Thu Aug 23 08:56:19 2012 +0900 +++ b/src/howtouse/TestSaxParser.java Thu Aug 23 09:01:52 2012 +0900 @@ -1,49 +1,15 @@ package howtouse; -import java.io.FileInputStream; import java.util.HashMap; import java.util.HashSet; -import java.util.Map; import java.util.Stack; -import javax.xml.parsers.SAXParser; -import javax.xml.parsers.SAXParserFactory; - import org.xml.sax.Attributes; import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; public class TestSaxParser extends DefaultHandler { - public static void main(String[] args) { - try { -// final String filename = "/Users/aotokage/testProgram/wiki/ja-pages_current.xml"; - final String filename = "./resource/article3.xml"; - FileInputStream fis = new FileInputStream(filename); - TestSaxParser sample = new TestSaxParser(); - - SAXParserFactory factory = SAXParserFactory.newInstance(); - SAXParser parser = factory.newSAXParser(); - - parser.parse(fis, sample); - HashMap<String,HashSet<String>> hash; - hash = sample.getHash(); - - - for (Map.Entry<String,HashSet<String>> entry : hash.entrySet()) { - String title = entry.getKey(); - System.out.println("title: " + title); - for (String link : entry.getValue()) { - System.out.println("\t"+link); - } - } - - - } catch (Exception e) { - e.printStackTrace(); - } - } - protected Stack<MyObject> stack; private MyObject currentObj; private Attributes currentAttr;