Mercurial > hg > Members > tatsuki > JungleXMLReader
changeset 4:9f6ac805d323
minner change
author | one |
---|---|
date | Fri, 24 Oct 2014 18:00:36 +0900 |
parents | 3dc5905739ef |
children | d098ef07214c |
files | src/main/java/jp/ac/u_ryukyu/cr/ie/tatsuki/bbs/JungleBulletinBoard.java src/test/java/jp/ac/u_ryukyu/cr/ie/tatsuki/xmlReadTest/SaxTest.java |
diffstat | 2 files changed, 2 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/jp/ac/u_ryukyu/cr/ie/tatsuki/bbs/JungleBulletinBoard.java Fri Oct 24 16:34:02 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/cr/ie/tatsuki/bbs/JungleBulletinBoard.java Fri Oct 24 18:00:36 2014 +0900 @@ -577,8 +577,8 @@ try { SAXParserFactory saxParserFactory = SAXParserFactory.newInstance(); SAXParser saxParser = saxParserFactory.newSAXParser(); - createBoards("XMLTEST"); - JungleTree tree = jungle.getTreeByName("XMLTEST"); + createBoards(xmlPath); + JungleTree tree = jungle.getTreeByName(xmlPath); ReadXmlHandler readXmlHandler = new ReadXmlHandler(tree); saxParser.parse(new FileInputStream("xml/" + xmlPath), readXmlHandler); } catch (Exception e) {
--- a/src/test/java/jp/ac/u_ryukyu/cr/ie/tatsuki/xmlReadTest/SaxTest.java Fri Oct 24 16:34:02 2014 +0900 +++ b/src/test/java/jp/ac/u_ryukyu/cr/ie/tatsuki/xmlReadTest/SaxTest.java Fri Oct 24 18:00:36 2014 +0900 @@ -20,18 +20,11 @@ class SaxTest { public static void main(String args[]) { try { - /* - * パーサのFactoryを作成 名前からしてFactoryパターンで,Singletonだと思う. - */ SAXParserFactory saxParserFactory = SAXParserFactory.newInstance(); - /* パーサを取得 */ SAXParser saxParser = saxParserFactory.newSAXParser(); Jungle jungle = new DefaultJungle(null, "hoge",new DefaultTreeEditor(new DefaultTraverser())); JungleTree tree = jungle.createNewTree("XMLTEST"); - /* イベントハンドラを作成 */ TestHandler testHandler = new TestHandler(tree); - - /* イベントハンドラに入力データとイベントハンドラを渡す */ saxParser.parse(new FileInputStream("/Users/e115731/workspace/aaa/xml/sample.xml"), testHandler); JungleTree newTree = testHandler.getTree(); InterfaceTraverser ifTraverser = newTree.getTraverser();