Saturday 25 March 2006 10:19:33 am
I'm trying to parse XHTML in ezxml and serialize it back to XHTML afterwards: My code:
$params= array("ConvertSpecialChars" => false);
$domTree = $ezxml->domTree( &$data, $params);
eZDebug::writeNotice($domTree->toString());
The following XHTML fragment is giving me trouble:
<section>
<p class="xfactbox">aaaaaaaa</p>
<p>
a aaa
<br />
<br />
</p>
<p class="xfactbox">
<span class="xemphasize">aaaaaaaaaa</span>
</p>
</section>
after serializing it back into a string I get
<?xml version="1.0" encoding="UTF-8"?>
<section>
<p class="xfactbox">aaaaaaaa</p>
<p>
a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; aaa
<br />
<br />
</p>
<p class="xfactbox">
<span class="xemphasize">aaaaaaaaaa</span>
</p>
</section>
i.e. the ampersand of the Entity gets escaped itself. I'm using ezpublish 3.6.6 on php 4.3.10, domxml is installed.
Visit http://triligon.org
|