dymon Posted March 15, 2007 Share Posted March 15, 2007 Hi, I use this function to create a new element, but sometimes I get an warning that I can not understand. function create_element($element, $content, $attribute, $attr_val) { global $xml; $elem = $xml->create_element($element); $elem->set_content($content); if ($attribute != '') { $elem->set_attribute($attribute, $attr_val); } return $elem; } The warning I get is: Warning: set_content(): unterminated entity reference Plaques of Pregnancy - PUPPP) in /var/www/atlas/submit/upload.php on line 47 Why does this error appear? I will be glad for any ideas. Thanks. Dymon Link to comment https://forums.phpfreaks.com/topic/42815-problems-with-dom-in-php/ Share on other sites More sharing options...
benjaminbeazy Posted March 15, 2007 Share Posted March 15, 2007 could be when and ampersand is sent, i'm pretty sure there isn't fix for that Link to comment https://forums.phpfreaks.com/topic/42815-problems-with-dom-in-php/#findComment-207840 Share on other sites More sharing options...
dymon Posted March 15, 2007 Author Share Posted March 15, 2007 Is this a bug or smth.? Maybe in some newer versions this can be fixed? Will it help if I will transform from simple & into & , maybe it could be a solution. Link to comment https://forums.phpfreaks.com/topic/42815-problems-with-dom-in-php/#findComment-207842 Share on other sites More sharing options...
benjaminbeazy Posted March 15, 2007 Share Posted March 15, 2007 no & wont work, as of 5.2 it still doesnt work, dont know about 5.2.1 Link to comment https://forums.phpfreaks.com/topic/42815-problems-with-dom-in-php/#findComment-207848 Share on other sites More sharing options...
dymon Posted March 15, 2007 Author Share Posted March 15, 2007 ok, is there an alternative way to write the element content, and not to get such a warning? Link to comment https://forums.phpfreaks.com/topic/42815-problems-with-dom-in-php/#findComment-207852 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.