DOM4J解析XML 求助
<?xml version= "1.0 " encoding= "utf-8 "?>
<itemlist>
<item name= "doctype " value= "doc type name "/>
<item name= "name1 " type= "string " value= "value1 "/>
<table name= "table1 " maxrow= " max row count ">
<row >
<item name= "name2 " type= "int " value= "value21 "/>
<item name= "name3 " type= "float " value= "value31 "/>
</row>
<row>
<item name= "name2 " type= "double " value= "value22 "/>
<item name= "name3 " type= "string " value= "value32 "/>
</row>
</table>
</itemlist>
应该如何取出对应的取值
------解决方案--------------------http://x.discuz.net/131976/viewspace-42521.html
有个例子你参考一下吧
------解决方案--------------------up
------解决方案--------------------同意3楼,给的例子与你唯一不同的是需要
element.attribute( "type ")
这样将元素的属性取出来