How to create CDATA section with DOM in PHP?
If i make it like this:
$xml = "<somexml>xyz</somexml>";
#create doc and root
$doc = new_xmldoc("1.0");
$root = $doc->add_root("root");
#create child with CDATA section
$root->new_child("data","<![CDATA[$xml]]>");
And want to get xml:
$result = $doc->dumpmem();
I get result like this:
<root>
<data>
<![CDATA[<somexml>xyz</somexml>]]>
</data>
</root>
ie. entities are escaped 🙁
Am i doing something completly wrong?
From DOM documentation i found function "createCDATAsection()" but there is nothing similar to it in php documentation about DOM.
Looks like it isn't implemented jet, but is there some other way to create CDATA section with DOM-XML in PHP?
With best,
.maRTin.