Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有疑问如何从 xml 获取 cdata?所以我的 xml 看起来像这样:
<tag><![CDATA[Text]]></tag>
我试图通过 getText()、getStringValue() 来获取消息,但它们返回给我空字符串;/ 知道我应该怎么做吗?
几乎没有火箭科学:
System.out.println(DocumentHelper .parseText("<tag><![CDATA[Text]]></tag>").getRootElement() .getText());