jdom.jar包(生成xml文件)
- 软件大小:144.00 KB
- 软件语言:中文
- 软件类型:国产软件 / 软件开发
- 软件授权: 免费软件
- 更新时间:2017-11-01 17:26:03
- 软件等级:
- 软件厂商: -
- 应用平台:WinXP, Win7, Win8, Win10
- 软件官网: http://www.itmop.com/
相关软件
Apache commons-codec-1.3.jar包免费版
50.00 KB/中文/10.0
ooxml-schemas-1.1.jar源码包官方免费版
10.12 MB/中文/10.0
commons-logging-1.1.1.jar maven官方免费版
60.00 KB/中文/2.0
maven commons-codec-1.9.jar免费版
213.00 KB/中文/0.0
mysql-connector-java-5.1.17-bin.jar(MySQL JDBC驱动包)免费版
744.00 KB/中文/10.0
软件介绍人气软件精品推荐相关文章网友评论下载地址
jdom.jar包(生成xml文件)分享给大家,本Jive(Jdon版)可在Jbuilder 7直接打开。建议你用Jbuilder7打开后,编辑相应设置(JDK1.4)本软件在linux+jdk1.4+tomcat 4以上环境运行正常,中文显示正常。
jdom.jar 用法:
依赖于jar包: dom4j.jar 和 jaxen-1.1.1.jar
Xml代码
1.
2.
3.D:\\index\\IndexDB
4.
Java代码
1. package com.wlh.dom4j.test;
2.
3. import org.dom4j.Document;
4. import org.dom4j.DocumentException;
5. import org.dom4j.Node;
6. import org.dom4j.io.SAXReader;
7.
8. public class TestReader {
9. public static void main(String args[]){
10. String filePath="index.xml";
11. try {
12. //如果配置文件是在Src下,则采用如下方式得到Document
13. Document document=new SAXReader().read(Thread.currentThread().getContextClassLoader().getResourceAsStream(filePath));
14. //如果配置文件是在本地文件系统,则采用如下方式得到Document
15. //Document document=new SAXReader().read("D:\\index.xml");
16. if (document == null) {
17. System.out.println(filePath+"没找到");
18. }else{
19. Node node=document.selectSingleNode("//list/index");
20. String indexfile=node.getText();
21. System.out.println(indexfile);
22. }
23. } catch (DocumentException e) {
24. e.printStackTrace();
25.
26. }
27. }
28. }
jdom读取xml文件:
依赖于jar包: jdom.jar
得到URL的方式:Thread.currentThread().getContextClassLoader().getResource(filePath)
Java代码
1. package com.wlh.dom4j.test;
2.
3. import java.io.IOException;
4. import java.util.List;
5.
6. import org.jdom.Document;
7. import org.jdom.Element;
8. import org.jdom.JDOMException;
9. import org.jdom.input.SAXBuilder;
10.
11. public class TestJdomReader {
12. public static void main(String args[]) {
13. String filePath = "zxt_index.xml";
14. String indexPath="";
15. SAXBuilder builder = new SAXBuilder(false);
16. try {
17. Document doc = builder.build(Thread.currentThread().getContextClassLoader().getResource(filePath));
18. Element books = doc.getRootElement();
19. Element rootElement= books.getChild("list");
20. Element index=rootElement.getChild("index");
21. indexPath=index.getText();
22. System.out.println(indexPath);
23. } catch (JDOMException e) {
24. e.printStackTrace();
25. } catch (IOException e) {
26. e.printStackTrace();
27. }
28.
29. }
30. }更多>> 软件截图
推荐应用
UXPin软件 49.76 MB
下载/中文/6.0 v2017 免费版visual studio 2017 702.00 KB
下载/中文/1.0 官方中文旗舰版ADT Plugin for Eclipse(Android开发工具) 98.00 MB
下载/中文/10.0 v23.06 官方最新版PEiD中文版 1.00 MB
下载/中文/10.0 v0.95 全插件汉化版hadoop 64位安装包 113.28 MB
下载/英文/10.0 v2.3 免费版XTreme Toolkit Pro 17(vc界面开发工具) 62.60 MB
下载/中文/0.0 v17.2.0 免费版android sdk完整包(包括SDK tools) 1.37 GB
下载/中文/2.0 v23.0.4 离线安装包myeclipse2017ci 1中文版 1.52 GB
下载/中文/6.0 免费汉化版
其他版本下载
- 查看详情 jdom.jar包(生成xml文件) 144.00 KB
- 查看详情 JBuilder 2008 R2企业版 32/64位 微软官方版 1.76 GB
- 查看详情 jbuilder中文版 v9.0 官方最新版 559.60 MB
精品推荐 jar包
- 更多 (132个) >> jar包 JAR(Java Archive,Java归档文件)是与平台无关的文件格式,它允许将许多文件组合成一个压缩文件.为J2EE应用程序创建的JAR文件是EAR文件(企业JAR文件).JAR文件格式以流行的ZIP文件格式为基础.与ZIP文件不同的是,JAR文件不仅用于压缩和发布,而且还
sqljdbc4.jar包 424.00 KB
/中文/1.0org.apache.poi jar包 28.65 MB
/中文/5.0spring-3.2 核心jar包 44.50 MB
/中文/10.0oracle12c jdbc jar驱动包 1.40 MB
/中文/0.0httpcore-ab-4.4.5.jar 286.00 KB
/中文/10.0httpcore4.4.4.jar包 3.00 KB
/中文/0.0jstl-1.2.jar包 378.00 KB
/中文/0.0ksoap2-android.jar 1.95 MB
/中文/0.0
相关文章
下载地址
jdom.jar包(生成xml文件)
查看所有评论>> 网友评论
更多>> 猜你喜欢