dom4j解析XML时,在读取cdata数据(里面是<div/>层)时,格式变成字符串了,请问怎样还原成原来有换行的格式
dom4j解析XML时,在读取cdata数据(里面是<div/>层)时,格式变成一个长字符串了,请问怎样还原成原来有换行的格式XML格式:</imcdatas><data...
dom4j解析XML时,在读取cdata数据(里面是<div/>层)时,格式变成一个长字符串了,请问怎样还原成原来有换行的格式
XML 格式:
</imcdatas>
<data>
<sqltype>1</sqltype>
<sql>insert into T_P () values(?,?,?)</sql>
<clob>
<![CDATA[
<div class="banner">
<ul style="position: relative; width: 2010px; height: 280px; left: -670px;">
<li style="position: absolute; top: 0px; left: 670px; z-index: 5; display: block;"><a href="#"><img src="http://localhost/resource/images/cp_game/1.jpg"></a></li>
<li style="position: absolute; top: 0px; left: 670px; z-index: 0; display: none;"><a href="#"><img src="http://localhost/resource/images/cp_game/2.jpg"></a></li>
<li style="position: absolute; top: 0px; left: 670px; z-index: 0; display: none;"><a href="#"><img src="http://localhost//resource/images/cp_game/3.jpg"></a></li>
</ul>
<ul class="pagination">
<span style="text-decoration: underline;">1</span>
<li class=""><a href="#2">3</a></li></ul>
</div>
]]>
</clob>
</data>
</imcdatas>
--------------------------------------------------------------------------------
JAVA 代码:DOM4j解析XML
clob = itemEle.elementTextTrim("clob");
System.out.println(clob);
输出来是一个长的字符串
在线求解,谢谢!! 展开
XML 格式:
</imcdatas>
<data>
<sqltype>1</sqltype>
<sql>insert into T_P () values(?,?,?)</sql>
<clob>
<![CDATA[
<div class="banner">
<ul style="position: relative; width: 2010px; height: 280px; left: -670px;">
<li style="position: absolute; top: 0px; left: 670px; z-index: 5; display: block;"><a href="#"><img src="http://localhost/resource/images/cp_game/1.jpg"></a></li>
<li style="position: absolute; top: 0px; left: 670px; z-index: 0; display: none;"><a href="#"><img src="http://localhost/resource/images/cp_game/2.jpg"></a></li>
<li style="position: absolute; top: 0px; left: 670px; z-index: 0; display: none;"><a href="#"><img src="http://localhost//resource/images/cp_game/3.jpg"></a></li>
</ul>
<ul class="pagination">
<span style="text-decoration: underline;">1</span>
<li class=""><a href="#2">3</a></li></ul>
</div>
]]>
</clob>
</data>
</imcdatas>
--------------------------------------------------------------------------------
JAVA 代码:DOM4j解析XML
clob = itemEle.elementTextTrim("clob");
System.out.println(clob);
输出来是一个长的字符串
在线求解,谢谢!! 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |