您的位置:学习中国 推荐教程 正文
原作者:kuku 添加时间:2007-06-02 原文发表:2007-06-02 人气:2 来源:互联网

本文章共2460字,分2页,当前第2页,快速翻页:
 
-----------------------------------------------------------------------------------------------------------------------------------------------

本文提示:《Php利用java解析xml(2)》是本站编辑们为广大网友精选的实用文章,本文阐述了关于文章的相关理论,相对来说专业性强,但是本文只是针对于某个问题提出的见解与论述,未必能辐射到相关问题的方方面面,所以本文处理问题的方法仅仅为您提供一些参考。更多问题请查阅学习中国网其他栏目哦.

-----------------------------------------------------------------------------------------------------------------------------------------------


public SAXBuilder sax=null; 
public Document doc=null; 
public Element root=null; 
public List xlist=null; 
public Element e=null; 
public Element value=null; 
public String getTest(){ 
return new String("haha"); 

public JavaXml(){ 

public String init(){ 
InputStream is = getClass().getResourceAsStream("global.properties"); 
Properties dbProps = new Properties(); 
try { 
dbProps.load( is ) ; 

catch ( Exception e ) { 
return ("error file"); 

this.path=dbProps.getProperty("XmlPath"); 
return ("ok"); 

public void get(int child){ 
this.e=(Element)xlist.get(child); 

public String getValue(String name){ 
this.value=e.getChild(name); 
return this.value.getText(); 

public void setValue(String name,String value)throws Exception{ 
this.value=e.getChild(name); 
this.value.setText(value); 
XMLOutputter xmlout=new XMLOutputter(); 
xmlout.output(doc,new FileOutputStream(path+XmlFileName)); 

public void Parse(String XmlFileName) 
throws Exception 

this.XmlFileName=XmlFileName; 
this.sax=new SAXBuilder(); 
this.doc=sax.build(new FileInputStream(path+XmlFileName)); 
this.root=doc.getRootElement(); 
this.xlist=root.getChildren(); 



 
本文章更多内容<<上一页 - 1 - 2
本页地址
收藏到:[收藏夹] [百度搜藏] [新浪ViVi] [POCO网摘] [ 和讯网摘] [好哦网摘] [Google书签]
               
[搜狐网摘] [365Key网摘] [天极网摘] [我摘] [博采网摘] [igooi网摘]
相关文章

使用PHP实现动态网页
使用PHP和XSL stylesheets转换XML文档
自己写的mysql类
在php中输出html代码
关于session的问题集锦解决方案
用PHP写的MD5加密函数
Win XP下全新安装Apache2,PHP5,MYSQL5
用PHP写FTP文件上传
几个php技巧
身份证方面的函数
MySQL数据库基础教程
PHP应用分页显示制作详细讲解
PHP安装攻略:安装并配置PHP
PHP中通过Web执行C/C++应用程序
PHP中实现面向对象编程
SSI使用详解(二)
SSI使用详解(一)
PHP和MySQL开发的8个技巧
虚拟主机中对PHP的特殊设置
提升PHP速度全攻略

相关评论


本文章所属分类:首页 推荐教程   PHP编程