Reputation: 67
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.
Upvotes: 7
Views: 44933
Reputation: 1
I had this error message "Extra content at the end of the document". Turned out the issue was in one of the tags there was no space between two attributes.
Upvotes: 0
Reputation: 596
Look at the XML. It should look something like the following:
<block>
<item>Here's an item</item>
<item>Here's another item</item>
<item>Here's an item with some sub-items
<subitem>one</subitem>
<subitem>two</subitem>
</item>
</block>
The root of the XML document is the block
item; it's the item that encloses and surrounds all of the other items.
If you don't have a root - ie, if the code looks something like this:
<item>Here's a list of items</item>
<item>But there's no root element</item>
Then you'll get the error you describe.
Upvotes: 3
Reputation: 489
Two possible options. It might be because the rendered XML is not valid. Sometimes, it might be because you don't have enough permissions to access the XML.
Upvotes: 0
Reputation: 619
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.
Upvotes: 6