คือผมเขียน php สร้าง xml ขึ้นมาน่ะครับ แล้วตัวแปรที่ดึงมาได้มันอยู่ในรูปนี้
function getSenses($lemma) {
$fh = fopen($file,"r"); //เปิดไฟล์ตาม path ที่ผมระบุใน $file
$fdata = fgets($fh,128); // ดึง data จากไฟล์ครับ หลังจากนี้จะเป็นการดึง text ไปใส่ใน tag ครับ
$sense[$numsenses]['definition'] = $fdata[0][1][0]; // โดยtag definition = $fdata[0][1][0] มีค่าเป็น <identity>ทารก</identity> ครับ
return array("lemma"=>array("identity"=>$lemma)); // tag identity = $lemma มีค่าเป็น <identity>เด็ก</identity> ครับ
}
เลยอยากทราบน่ะครับว่า ผมจะครอบ CDATA ใน php ยังไงครับ
$str ='<childNode><![CDATA['.$data.']]></childNode>';
หรือเปล่าครับ....
แบบนี้ลองแล้วครับ มันไม่ได้ครับ เหมือนว่ามันมองเป็น text แทน มันยังได้ error แบบนี้ครับ
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
--------------------------------------------------------------------------------
An invalid character was found in text content. Error processing resource '
http://localhost/visuwords/v2.0/lex.php?find= 
คำ'...