尤专门的xml文件操作的类,你直接查问党就可以哦了阿
解决方案 »
- tiles的CompleteAutoloadTilesListener的上下文配置问题,求高手指教
- jsf例子在Tomcat下不能发布
- 怎样把两个ByteBuffer合并成一个?
- 要买个笔记本做开发,请问什么样的配置比较合适?请大家多多指导
- 求救!!
- web开发中内存泄露问题探讨
- ApplicationResources.properties 是什么文件?????
- 大家帮忙看一看,Tomcat远程访问mysql的问题在线等,本人刚来论坛分嫌少的以后补,谢了
- 求:J2EE中类似word功能实现(主要排版、保存、浏览、客户端打印)。
- HTTP Status 500 - An exception occurred processing JSP page /WEB-INF/include/tag
- 一个关于NoClassDefFoundError的问题?
- 急问struts中treeview中显示问题,恳请struts中做过treeview的高手提醒!!
import org.jdom.input.*;
import org.jdom.*;
import java.util.*;
import java.io.*;
public class XMLExample2
{
public static void main(String[] args)
{ SAXBuilder sb = new SAXBuilder();
try {
Document doc = sb.build(new FileInputStream("text1.xml"));
Element root = doc.getRootElement();
System.out.println("节点名:"+root.getName());
List lProperty = root.getAttributes();
Iterator it = lProperty.iterator();
while(it.hasNext())
{
System.err.println(" : "+root.getAttribute(((Attribute)it.next()).getName()).getValue());
}
List ro = root.getChildren();
Iterator it1 = ro.iterator();
while(it1.hasNext())
{
Element el = (Element)it1.next();
lProperty = el.getAttributes();
Iterator it2 = lProperty.iterator();
while(it2.hasNext())
{
System.err.println(" : "+el.getAttribute(((Attribute)it2.next()).getName()).getValue());
}
}
}catch(Exception e)
{
e.printStackTrace();
}
}
}
<VInfo ID='abc' Name='other'>
<I User="KK" N="oo"/>
<I User="KK" N="oo"/>
</VInfo>