易截截图软件、单文件、免安装、纯绿色、仅160KB

xml operation

package demo.oath ;
import org.jdom.* ;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2006</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class AccountHelper
{
public final static String XML_ACCOUNT_ROOT = "DB" ;
public final static String XML_ACCOUNT_ACCOUNT = "Account" ;
public final static String XML_ACCOUNT_NAME = "name" ;
public final static String XML_ACCOUNT_INDEX = "index" ;
public final static String XML_ACCOUNT_PASSWORD = "passwd" ;
public final static String XML_ACCOUNT_COUNTER = "counter" ;
public final static String XML_ACCOUNT_LOCKED = "locked" ;
public final static String XML_ACCOUNT_COST = "cost";
public final static String XML_TTY_COUNTER = "tryCounter";
public static void main(String[] args) {
Element e=new Element("Account");
System.out.println(AccountHelper.Element2Account(e));
}
/**
* parst element to Account
* @param e
* @return
*/
public static Account Element2Account ( Element e )
{
System.out.println("AccountHelper.XML_TTY_COUNTER="+AccountHelper.XML_TTY_COUNTER);
String index = e.getChildText ( AccountHelper.XML_ACCOUNT_INDEX ) ;
String userName = e.getChildText ( AccountHelper.XML_ACCOUNT_NAME ) ;
String passwd = e.getChildText ( AccountHelper.XML_ACCOUNT_PASSWORD ) ;
String cost = e.getChildText(AccountHelper.XML_ACCOUNT_COST);
String tryCounter = e.getChildText(AccountHelper.XML_TTY_COUNTER);
System.out.println("tryCounter="+tryCounter);
System.out.println("-------------------------------------cost-------------------------");
System.out.println(cost);
System.out.println("--------------------------------------end");
String counter = e.getChildText ( AccountHelper.XML_ACCOUNT_COUNTER ) ;
int counterI=0


相关文档:

XML格式转化工具类

基于dom4j的XML格式转化类
package com.lixi.util;
import java.io.BufferedWriter;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import org.dom4j.Document;
import org.do ......

XML的使用


写XML:
    protected void btnSave_Click(object sender, EventArgs e)
    {
        //权限判断
        XmlTextWriter xmlw = new XmlTextWriter(Server.MapPath("~\\") + "FriendLink.xml", Encoding.Ge ......

10本经典XML及Web相关电子书


XML How to Program

Beginning Xml Databases

Beginning XSLT and XPath Transforming XML Documents and Data

ASP.NET 2.0 XML

XML 手册 4th Edition

XML Schema Complete Reference
......

JAVA 中用XML实现INI文件格式的解决方案

        这篇文章被转载的次数最多,其实代码简陋得我自己都看不下去。只不过发表这篇文章时很多人需要这个功能。
     
      这几天写个数据库查询分析器,要用到XML记录用户注册的数据库连接地址、端口等信息,最开始想用java ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号