Why XSLT can't transform CDATA which contains a blank String
for example
DocumentBuilderFactory dbf= DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.newDocumentBuilder().newDocument();
doc.appendChild(doc.createElement("ROOT"));
doc.getDocumentElement().appendChild(doc.createCDATASection(""));
when I use javax.xml.transform.Transformer to transform this Document,
the xslt result is:
<?xml version="1.0" encoding="UTF-8"?>
<ROOT/>
but I want to get
<?xml version="1.0" encoding="UTF-8"?>
<ROOT><![CDATA[]]></ROOT>
Anyone can help???
Thanks!