如何修改文本中的指定内容?(此文本为.xml文件)
文本内容如下:
<net>
<uc id="1">
<table><tr><td>AAA</td></tr></table>
</uc>
<uc id="2">
<table><tr><td>BBB</td></tr></table>
</uc>
<uc id="3">
<table><tr><td>CCC</td></tr></table>
</uc>
</net>想将id="2"的修改为<table><tr><td>DDD</td></tr></table>,其他保留不变,要怎么写代码(java)
文本内容如下:
<net>
<uc id="1">
<table><tr><td>AAA</td></tr></table>
</uc>
<uc id="2">
<table><tr><td>BBB</td></tr></table>
</uc>
<uc id="3">
<table><tr><td>CCC</td></tr></table>
</uc>
</net>想将id="2"的修改为<table><tr><td>DDD</td></tr></table>,其他保留不变,要怎么写代码(java)
而是希望能通过io来,对此文本进行插入、修改和删除指定某个区域(区域指从<uc id="xxx">到</uc>)