problem with xml data in textarea/input


I want to edit XML data in a dhtmlxform.

Is there any way to avoid “Incorrect XML” problems while loading the form from an XML file where the initial value of the XML input field already contains XML data with < and > characters.

Is it possible to use cdata?



For now this works in php:

  $value = str_replace('&','&amp;',$value);
  $value = str_replace('"','&quot;',$value);
  $value = str_replace('<','&lt;',$value);
  $value = str_replace('>','&gt;',$value);

where $value is the initial value for the input field from the database wich contains xml special characters.

Maybe there is a better solution.



Hi all

Correct, you can try cdata or escaping.