Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XML Error: Extra content at the end of the document

This is the XML:

<?xml version="1.0" encoding="ISO-8859-1"?> <document> <name>Sample Document</name> <type>document</type> <url>http://nsc-component.webs.com/Office/Editor/new-doc.html?docname=New+Document&amp;titletype=Title&amp;fontsize=9&amp;fontface=Arial&amp;spacing=1.0&amp;text=&amp;wordcount3=0</url> </document>  <document> <name>Sample</name> <type>document</type> <url>http://nsc-component.webs.com/Office/Editor/new-doc.html?docname=New+Document&amp;titletype=Title&amp;fontsize=9&amp;fontface=Arial&amp;spacing=1.0&amp;text=&amp;</url> </document> 

When I open it it says: This page contains the following errors: error on line 8 at column 1: Extra content at the end of the document

But when there is only this:

<document> <name>Sample</name> <type>document</type> <url>http://nsc-component.webs.com/Office/Editor/new-doc.html?docname=New+Document&amp;titletype=Title&amp;fontsize=9&amp;fontface=Arial&amp;spacing=1.0&amp;text=&amp;</url> </document> 

Why is it saying this when there is two?

like image 916
electrikmilk Avatar asked May 31 '13 15:05

electrikmilk


People also ask

Is Invalid XML declaration allowed only at the start of the document?

Bookmark this question.


1 Answers

You need a root node

<?xml version="1.0" encoding="ISO-8859-1"?>     <documents>     <document>         <name>Sample Document</name>         <type>document</type>         <url>http://nsc-component.webs.com/Office/Editor/new-doc.html?docname=New+Document&amp;titletype=Title&amp;fontsize=9&amp;fontface=Arial&amp;spacing=1.0&amp;text=&amp;wordcount3=0</url>     </document>      <document>         <name>Sample</name>         <type>document</type>         <url>http://nsc-component.webs.com/Office/Editor/new-doc.html?docname=New+Document&amp;titletype=Title&amp;fontsize=9&amp;fontface=Arial&amp;spacing=1.0&amp;text=&amp;</url>     </document> </documents> 
like image 133
Lotok Avatar answered Sep 19 '22 13:09

Lotok