/**
 * Alipay.com Inc.
 * Copyright (c) 2004-2016 All Rights Reserved.
 */
package org.dolphin.study.java.xml;

import java.io.InputStream;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

/**
 *
 * @author sunqi
 * @version $Id: SAXTest.java, v 0.1 2016118 11:17:22 sunqi Exp $
 */
public class SAXTest {
    /** */
    private static Logger logger = LogManager.getLogger(DomTest.class);

    /**
     * SAXXML
     */
    public void testSaxParse() {
        InputStream inputStream = DomTest.class.getClassLoader().getResourceAsStream(
            "xml/books.xml");
        
    }
}

@@ -134,16 +134,96 @@
 tream;%0A%0A
+import javax.xml.parsers.SAXParser;%0Aimport javax.xml.parsers.SAXParserFactory;%0A%0A
 import o
@@ -297,16 +297,59 @@
 .Logger;
+%0Aimport org.xml.sax.helpers.DefaultHandler;
 %0A%0A/**%0A *
@@ -606,16 +606,34 @@
 rse() %7B%0A
+        try %7B%0A    
         
@@ -722,16 +722,20 @@
         
+    
 %22xml/boo
@@ -756,13 +756,419 @@
     
-%0A    %7D%0A%7D%0A
+    SAXParserFactory factory = SAXParserFactory.newInstance();%0A            SAXParser parser = factory.newSAXParser();%0A            parser.parse(inputStream, new BooksHandler());%0A        %7D catch (Exception e) %7B%0A            logger.error(%22parse exception%22, e);%0A        %7D%0A    %7D%0A%7D%0A%0A/**%0A *%0A * @author sunqi%0A * @version $Id: SAXTest.java, v 0.1 2016119 3:52:36 sunqi Exp $%0A */%0Aclass BooksHandler extends DefaultHandler %7B%0A%0A%7D

add SAXTest