dom4j解析xml生成html
最近因为项目的需要,需要解析xml。本人在xml这方面完全是个菜鸟,有哪位大虾给予帮助,感激不尽,分数多多
本人的要求如下:
有一个.xml文件:
<modes>
<line id="1">
<cell x="1" value=""/>
<cell x="2" value=""/>
<cell x="3" value=""/>
<cell x="4" cols="14" style="label" value="AAAAAAAAAAAAAAAAAAAAAAAAAAAAA">
<font>宋体;B;12 </font>
</cell>
<cell x="18" value=""/>
<cell x="19" value=""/>
<cell x="20" value=""/>
</line>
<line id="2">
<cell x="1" value=""/>
<cell x="2" value=""/>
<cell x="3" value=""/>
<cell x="4" value=""/>
<cell x="5" value=""/>
<cell x="6" value=""/>
<cell x="7" value=""/>
<cell x="8" value=""/>
<cell x="9" value=""/>
<cell x="10" value=""/>
<cell x="11" value=""/>
<cell x="12" value=""/>
<cell x="13" value=""/>
<cell x="14" value=""/>
<cell x="15" cols="6" style="label" value="AAAAAAAAAAA"/>
</line>
<line id="3">
<cell x="1" value=""/>
<cell x="2" cols="5" style="label" value="AAAA"/>
<cell x="7" cols="5" style="text" class="string" value="AAAA" ref="1"/>
<cell x="12" value=""/>
<cell x="13" value=""/>
<cell x="14" value=""/>
<cell x="15" cols="6" style="label" value="SSSSSSSSS"/>
</line>
<line id="4">
<cell x="1" value=""/>
<cell x="2" value=""/>
<cell x="3" value=""/>
<cell x="4" value=""/>
<cell x="5" value=""/>
<cell x="6" cols="6" style="label" value="CCCCC" lb="1" tb="1" rb="1" bb="1"/>
<cell x="12" cols="2" style="label" value="XXXXXX" lb="1" tb="1" rb="1" bb="1"/>
<cell x="14" style="label" value="XXX" lb="1" tb="1" rb="1" bb="1"/>
<cell x="15" cols="2" style="label" value="XXXXXX" lb="1" tb="1" rb="1" bb="1"/>
<cell x="17" value=""/>
<cell x="18" value=""/>
<cell x="19" value=""/>
<cell x="20" value=""/>
</line>
<line id="5">
<cell x="1" value="&qu