java xml文件解析 - Java / Eclipse
<categorys>
<item>
<type>ALL</ type>
<name>全部信息</name>
</item>
<item>
<type>per</ type>
<name>信息</name>
<Tables>
<Table name="table1">
<Sys>信息1</Sys>
<Topic>信息</Topic>
<ID>AB002002</ID>
</Table>
</Tables>
</item>
<item>
<type>cor</ type>
<name>信息</name>
<Tables>
<Table name="table2">
<Sys>信息2</Sys>
<Topic>信息</Topic>
<ID>AA001020</ID>
</Table>
</Tables>
</item>
</categorys>
在解析这个文件的时候。当解析到<type>ALL时候。我希望将下面两个<type>per和<type>cor里面的<Tables>加入到其中。
就是说all里面要包含per和cor里tables里的所有元素。
在解析的时候该怎么处理?
用xpath
好像是 //type
用dom4J
document.selectNodes("//article")
相关问答:
当知道一个日期,如何把这个日期所在旬的前后两个日期取出
比如输入20090905,就输入20090901 20090910
输出20090901 20090910
取得天数后作一下判断再把这个方法用下void set(int field, int value)
......
我JSP的页面是:
<%@ page language="java" contentType="text/html; charset=gb2312"
%>
<script>
function Save(){
xmlHttp=GetXmlHttpObject()
if(xmlHttp==nul ......
代码如下 ,我想通过代理访问一些网址,但是不知道如何测试代理成功,我想通过访问“http://www.blogger.com/”来看看是否代理成功,但是也不能访问,出现异常“Unexpected end of file from server”,但是如果不这 ......
现在有个xml文件是<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xm ......
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 52 in the jsp file: /vip_info.jsp
ÕË cannot be resolved
49: <table border="1& ......