XML Parsing Error: junk after document element - PHP

malsmadi

New Member
I was dynamically creating XML File in PHP. I was taking hints from StackOverflow. I was trying the first answer for that question. Obviously it was working good and not working certain circumstances. I was dynamically passing the arrays into that xml file. The field Description contains some special characters i think so and i was getting the error "XML Parsing Error: junk after document element". I was trying various possibilities. One such is the following which will make escape from the special characters.\[code\]echo "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>";\[/code\]But it doesn't works for me well. Kindly give me some suggestion how to solve this case.
 
Back
Top