samiuddin_adse — 2011-09-21T08:04:31-04:00 — #1
I am new to xml.
I am trying to generate the xml file by looping through records from database. It is working fine. But if the data field is having
any special character like & it is giving error xml parse error.
I came to know that we can use CDATA to avoid it.
please let me know how to use CDATA
print($row['pickup_addr']); //value for internal code
on this I want to use CDATA
please help me out
gvre — 2011-09-21T08:50:13-04:00 — #2
samiuddin_adse — 2011-09-21T08:56:40-04:00 — #3
thanks for your reply
I checked the link. But it is not there what i am looking for
gvre — 2011-09-21T09:21:15-04:00 — #4
A CDATA section starts with "<![CDATA[" and ends with "]]>". You can use one of the following examples.
echo "<cell><![CDATA[" . $row['pickup_addr'] . "]]></cell>";
return "<![CDATA[" . $s . "]]>";
echo "<cell>" . cdata($row['pickup_addr']) . "</cell>";