xml
来源:互联网 发布:淘宝无线模板 编辑:程序博客网 时间:2024/06/03 05:36
用jdom写xml文件
publicclass App
{
publicstaticvoid main( String[] args )throws Exception
{
OutputStream out = new FileOutputStream("d:/customers.xml");
Document document = new Document();
Element root = new Element("customers");
document.setRootElement(root);
for(int i=0;i<10;i++){
Element ec = new Element("customer");
Element namee = new Element("cname");
namee.addContent("fiona"+i);
Element passworde = new Element("password");
passworde.addContent("123"+i);
Element birthe = new Element("birth");
birthe.addContent("1992-10-1"+i);
ec.addContent(namee);
ec.addContent(passworde);
ec.addContent(birthe);
root.addContent(ec);
}
XMLOutputter outputter = new XMLOutputter();
outputter.setFormat(Format.getPrettyFormat());
outputter.output(document, out);
out.close();
}
}
- XML
- XML
- XML
- XML
- xml
- xml
- XML
- XML
- XML
- xml
- xml
- XML
- XML
- xml
- xml
- xml
- XML
- XML
- Android 签名+混淆( 签名+proguard.cfg)
- String的拼接和常量池
- 常见面试题
- [Docker 官方文档] 理解 Docker
- CentOS网络简单配置
- xml
- Geant4.10.1.p02例子学习之一(basic)
- jQuery插件-div中滚动图片
- NYOJ-757-期末考试
- GlassFish发布Web Service服务和Eclipse 建立web Service测试客户端
- Shell 整数比较、字符串比较
- JS函数的定义与调用方法
- android Activity 生命周期 学习笔记
- linux下imagemagick批量处理图片命令