xmlbeans XMLSpy 解析xml
来源:互联网 发布:linux如何打开根目录 编辑:程序博客网 时间:2024/05/19 23:00
Altova XMLSpy 把xml解析成xsd文件
下载xmlbeans 注意:jar 配置path
scomp -src src -out XmlBean.jar 88.xsd -compiler "C:/Program Files/Java/jdk1.6.0/bin/javac" 88.xsdconfig
新建项目 导xmlb里的jar 加上刚生成的jar
写一个类似的类
import java.io.File;
import java.io.UnsupportedEncodingException;
import sample.xmlbean.*;
import sample.xmlbean.CardItemDocument.CardItem;
import sample.xmlbean.ProductItemDocument.ProductItem;
import sample.xmlbean.TotalMenuDocument.TotalMenu;
import org.apache.xmlbeans.XmlOptions;
public class bean {
private String filename = null;
public bean(String filename) {
super();
this.filename = filename;
}
public void Reader() {
try {
File xmlFile = new File(filename);
TotalMenuDocument doc = TotalMenuDocument.Factory.parse(xmlFile);
ProductItem [] productItem = doc.getTotalMenu().getProductItemArray();
for (int i = 0; i < productItem.length; i++) {
ProductItem ProductItem = productItem[i];
println("Customer#" + i);
println("Customer ID:" + ProductItem.getRechargeURL());
println("Customer ID:" + ProductItem.getKeyWord());
println("Customer ID:" + ProductItem.getLetterCode());
println("Customer ID:" + ProductItem.getProductID());
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
private void println(String str) {
try {
str=new String(str.getBytes("GB2312"));
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println(str);
}
public static void main(String[] args) {
String filename = "D://QQProductListService.xml";
bean bean = new bean(filename);
bean.Reader();
}
}
- xmlbeans XMLSpy 解析xml
- xmlbeans解析XML文件全流程+Altova XMLSpy破解
- 使用xmlbeans解析xml
- XMLBEANS--XML解析的另一种选择
- XML第三讲:XMLSpy详解、有效的XML文档解析
- XMLSpy处理XML
- xmlbean+xmlspy 编辑xml
- 使用XMLBeans 处理XML
- 使用XmlBeans读写xml
- xmlbeans 封装xml
- 用XmlBeans处理XML文档
- XMLSpy
- xmlbeans
- xml schema 开发测试工具 Altova XMLSpy
- XML&Java&XMLBeans结合应用的价值
- 如何用xmlspy将xml文档生成xsd文件?
- 使用XMLBeans处理XML数据和文档入门
- 如何使用XMLBeans兼容Java与XML应用开发
- Java实现简单的计算器(GUI编程)
- 字符串截取 多样化.
- Delphi ListView的用法(常用技巧)[转载]
- SQL Server连接失败错误及解决(图)
- 使用Properties文件配置实例的创建
- xmlbeans XMLSpy 解析xml
- Windows Mobile 6中国主创团队谈感受
- K2与SharePoint 2003集成特征
- SYMBIAN描述符浅析
- Linux下Apache并发连接数和带宽控制
- Top 5 common mistakes to cause memory leaks in Symbian C++ applications
- 生化危机3下载地址
- 怎样保护Linux系统下的Apache网站
- 如何使用K2.Net 2003设计流程