writing xml data to oracle database



I have created a php script to read data from xml and write it to oracle database the xml data has html tags. which are in various language like English,Russian,Italian,German.


In php I am reading data from xml as



$xml=simplexml_load_file($file);
foreach($xml as $value)
{
$text='';
if($value->englishtext=='')
{
$text=htmlentities(str_replace("'", "'", $value->translatedtext), ENT_HTML5);
}
else
{
$text=htmlentities(str_replace("'", "'", $value->englishtext), ENT_HTML5);
}
}


the insert query is INSERT INTO Internationalization VALUES (seq_id.nextval,$text)


My real problem is some times the data is inserted correctly,and some times the html tags are not correctly encoded.


Can any body suggest me



  1. weather i should use htmlentities() or not.

  2. What i should do to display these html tags in html5.


No comments:

Post a Comment