SAX DOM解析xml
2016-02-24 19:20
357 查看
1 获取XML文件的绝对路径
2,BookHandle h=new BookHandle();
3,SAXParserFactory factory=SAXParserFactory.newInstance();
4,SAXParser p=factory.newSAXParser();
5.p.parse(path,h);
DOM(document object model)解析xml
1 SAXReader reader=new SAXReader();
2 Document doc=reader.read(path);
Element e=doc.getRootEllement();
Iterator it=e.attributeIterator();
Attribute a=(Attribute)it.next();
a.getName();
a.getValue()
2,BookHandle h=new BookHandle();
3,SAXParserFactory factory=SAXParserFactory.newInstance();
4,SAXParser p=factory.newSAXParser();
5.p.parse(path,h);
DOM(document object model)解析xml
1 SAXReader reader=new SAXReader();
2 Document doc=reader.read(path);
Element e=doc.getRootEllement();
Iterator it=e.attributeIterator();
Attribute a=(Attribute)it.next();
a.getName();
a.getValue()
相关文章推荐
- angluar根据链接的url参数的不同实现显示与隐藏
- CocoaAsyncSocket 与 Java服务 交互
- Linux中操作SVN
- linux下perl及cgi.pm的安装(perl-5.22.1)
- test测试数据
- cx_Oracle.InterfaceError: Unable to acquire Oracle environment handle
- ReactiveCocoa框架菜鸟入门——信号(Signal)详解 第四课
- iOS 设置group类型tableview的section间距
- android存储的理解
- poj 1751 Highways
- s3c2440学习笔记 串口
- 网络的理解2
- VS2015转VS2008
- 第三方SDK:RongCloud IMKit实现简单的单人会话
- 自定义View
- ReactiveCocoa框架菜鸟入门——信号(Signal)详解 第三课:
- io流的理解
- Regular Expression Matching
- LVS负载均衡之session解决方案 持久连接
- bzoj 2242 [sdoi2011]计算器