Hey all, Simple question. Is it possible to add a block of HTML in a SimpleXMLElement (or as a matter of fact, DOMDocument) node without auto-converting the HTML data into entity format?
For example, take this snippet (with DOMDocument here, but SimpleXMLElement behaves exactly the same):
<?php
$dom = new DOMDocument( '1.0', 'utf-8' );
$de = $dom->createElement( 'content', '<p>some <a>stuff</a></p>' );
$dom->appendChild( $de );
echo $dom->saveXML();
?>
The output is:
<p>some <a>stuff</a></p>
If you take a look at the source, you'll see:
<?xml version="1.0" encoding="utf-8"?>
<content><p>some <a>stuff</a></p></content>
... the HTML block got auto converted into the entity format.
Even wrapping the block with CDATA doesn't help, as the angular brackets of CDATA gets converted too.
So, is there a way to add HTML blocks like this without performing this auto-conversion?
Thanks, m^e