XML Parsing error : Extra content at the end of the document

user1640328 picture user1640328 · Sep 1, 2012 · Viewed 36.5k times · Source

Firstly , good day to everyone. I have this script which handles the login to my database : http://pastebin.com/ctUEczRf I used pastebin because it was too long to use code tags. When I run it It returns me this :

This page contains the following errors:

error on line 2 at column 1: Extra content at the end of the document
Below is a rendering of the page up to the first error.

I don't know how to solve it , I never used XML before. This was given to me along with the CMS.

Answer

barefootliam picture barefootliam · Sep 2, 2012

Pasting the XML that's generated is probably what you'd need to do. My guess is that you are generating XML with multiple top-level elements; XML requires that you have a single wrapper element at the top level and have all other elements inside it: it's a tree, not a forest.

My second guess is that you are seeing the error in your Web browser, and it is not being generated by php at all; check your Web server error logs to make sure.