資源簡介
不用任何jar包,解析xml內(nèi)容。相同節(jié)點(diǎn)多個(gè)時(shí)。可以一次解析所有的內(nèi)容。
代碼片段和文件信息
package?cn.com.wdc.sun.xml;
public?class?Test?{
public?static?void?main(String[]?args)?{
try?{
String?xmldoc?=?““+
???? “ “+
???? “ “+
???? “ “+
???? “ “+
???? “ “;
/**
?*第三個(gè)參數(shù)為獲取第幾個(gè)節(jié)點(diǎn)里的內(nèi)容
?*如果為0或大于節(jié)點(diǎn)數(shù),就會(huì)取出所有
?*/
String?sb?=?xmlNode(xmldoc“EdorDetail“0);
/**
?*取出的內(nèi)容以“”分割。
?*/
System.out.println(sb.replaceAll(““?“\r\n“));
}?catch?(Exception?e)?{
e.printStackTrace();
}
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件????????314??2013-05-24?11:45??xm
?????文件?????????66??2013-05-24?11:46??xm
?????文件????????379??2013-04-01?11:26??xm
?????文件???????1743??2013-05-24?11:43??xm
?????文件???????3366??2013-05-24?11:42??xm
?????目錄??????????0??2013-05-24?11:34??xm
?????目錄??????????0??2013-05-24?11:34??xm
?????目錄??????????0??2013-05-24?11:34??xm
?????目錄??????????0??2013-05-24?11:34??xm
?????目錄??????????0??2013-05-24?11:34??xm
?????目錄??????????0??2013-05-24?11:34??xm
-----------?---------??----------?-----??----
?????????????????5868????????????????????11
評(píng)論
共有 條評(píng)論