Posted by A.Martini on 02/19/07 22:29
A.Martini wrote:
Hello,
Analyzing more in depth the problem i discovered that I have to substitute
all the &#nnn; and &#nnnn; with their <![CDATA[&#nnn;]]> and <
[CDATA[&#nnnn;]]> so encoding will pass thru the parser properly and are
not substitued by ?.
Now the challenge is to find a regular expression to do the substitution of
all:
&#nnn; -> <![CDATA[&#nnn;]]>
and
&#nnnn; -> <![CDATA[&#nnnn;]]>
I have write a new function
function cdataize($content)
{
$content = preg_replace('/\&\#([0-9]+);/','<![CDATA[&#\\1;]]>',$content);
return($content);
}
This will solve the problem in a more elegant way :-)
[Back to original message]
|