I have a big xml document 250mb, which one of the tags contains another xml that I need to process.
But the problem is, this xml is wrapped by CDATA and if I try to do a replace/replaceAll
String xml= fileContent.replace("<![CDATA[", " ");
String replace = xml.replace("]]>", " ");
I'm gettig
java.lang.OutOfMemoryError: Java heap space
A simple example of the structure.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<a>
<b>
<c>
<![CDATA[<?xml version="1.0" encoding="UTF-8" standalone="yes"?><bigXML>]]>
</c>
</b>
</a>
Even using XML parser like VDT or SAX it does not help because I still need to remove the <