I'm trying to get cdata text from a node using dom4j java. My issue here is that all of the line breaks are removed. Essentially, I need to read the contents of the CDATA as if it were a <pre> tag in HTML.
Do you have any ideas? I have a very small time to get this done unfortunately so any help would be appreciated.
Thanks!
If you need XML text to be statically defined as in a CDATA block, it must be flagged this way in the XML as such:
<tag><![CDATA[This is
three
lines]]></tag>
If your contents is not inside a CDATA section, i.e.:
<tag>This is
three
lines</tag>
normal XML processing will occur which means that the whitespace is normalised.