I am generating \[code\]xml\[/code\] file dynamically and getting error when i include newstext. \[code\]Error: XML Parsing Error: undefined entity\[/code\] !
By remove newstext \[code\]xml\[/code\] generates perfectly. Here is the code i am using.\[code\]$sqlNews = "SELECT * FROM news";$runSqlNews = mysql_query($sqlNews);while ($rowSqlNews = mysql_fetch_array($runSqlNews)) $arrSqlNews[] = $rowSqlNews; header('Content-type: text/xml'); header('Pragma: public'); header('Cache-control: private'); header('Expires: -1'); echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; echo '<xml>';for($i=0;$i<count($arrSqlNews);$i++) { echo "<news>"; echo "<newsId>".$arrSqlNews[$i][id]."</newsId>"; echo "<newsAuthor>".$arrSqlNews[$i][news_author]."</newsAuthor>"; echo "<newsText>".$arrSqlNews[$i][news_text]."</newsText>"; echo "<description>".$arrSqlNews[$i][news_description]."</description>"; echo "<image>".$arrSqlNews[$i][news_image]."</image>"; echo "</news>"; } echo '</xml>';\[/code\]Hope my question is clear. Thanks in Advance !!
By remove newstext \[code\]xml\[/code\] generates perfectly. Here is the code i am using.\[code\]$sqlNews = "SELECT * FROM news";$runSqlNews = mysql_query($sqlNews);while ($rowSqlNews = mysql_fetch_array($runSqlNews)) $arrSqlNews[] = $rowSqlNews; header('Content-type: text/xml'); header('Pragma: public'); header('Cache-control: private'); header('Expires: -1'); echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; echo '<xml>';for($i=0;$i<count($arrSqlNews);$i++) { echo "<news>"; echo "<newsId>".$arrSqlNews[$i][id]."</newsId>"; echo "<newsAuthor>".$arrSqlNews[$i][news_author]."</newsAuthor>"; echo "<newsText>".$arrSqlNews[$i][news_text]."</newsText>"; echo "<description>".$arrSqlNews[$i][news_description]."</description>"; echo "<image>".$arrSqlNews[$i][news_image]."</image>"; echo "</news>"; } echo '</xml>';\[/code\]Hope my question is clear. Thanks in Advance !!