SAX解析XML文件
程序员文章站
2022-03-03 15:06:18
...
books.xml
<?xml version="1.0" encoding="UTF-8" ?>
<bookstore>
<book id = "1">
<name>冰与火之歌</name>
<author>
<phone>123123</phone>
<email>
<qq>13dpwe</qq>
</email>
</author>
<year>2014</year>
<price>89</price>
</book>
<book id = "2">
<name>安徒生童话</name>
<year>2014</year>
<price>77</price>
<language>English</language>
</book>
</bookstore>
SAXParse.java
package com.uplooking.dom;
import com.uplooking.bean.Book;
import com.uplooking.bean.Resource;
import com.uplooking.sax.MyDefaultHandler;
import org.xml.sax.Attributes;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
impo
上一篇: SAX解析XML文件
下一篇: SAX解析XML文件