I know this inproper, but the company "on the other hand" for some reason forces us to change this code:
<POZ />
in
<POZ><!CDATA[[]]></POZ>
I found forced removal of CDATA elements , but this requires an additional XSL file, and I would like to avoid this.
I tried trivially
Element poz = new Element("POZ");
CDATA cdataContent = new CDATA("");
poz.addContent(cdataContent);
but he, of course, generates simple
<POZ />
not the extended version that I expect ...
Is there a way to get JAVA to generate these CDATA sections in empty elements?
source
share