Xml Parse Error - Extra Content at the End of the Document

XML Error: Extra content at the end of the document

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&titletype=Title&fontsize=9&fontface=Arial&spacing=1.0&text=&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&titletype=Title&fontsize=9&fontface=Arial&spacing=1.0&text=&</url>
</document>
</documents>

XML Parsing error at line N extra content at the end of the document

You'll have to fix at least these two problems:

  1. You close the xs:schema tag on line2, before the rest of your XSD.

  2. You use a self-closing xs:element tag on line 3 where you probably wanted it to be the parent of the xs:complexType element on the following line.

In general, the error is due to violating the rule that an XML document is only allowed to have a single root element. No markup may follow the single root element.

XML Parse Error - Extra content at the end of the document

XML can only have one "document entity" or "root", you're trying to use two (status and format). Wrap your two elements in a single one, so that your XML document only has one root element.

Bad

<?xml version="1.0"?>
<status>success</status>
<format>xml</format>

Good

<?xml version="1.0"?>
<response>
<status>success</status>
<format>xml</format>
</response>


Related Topics



Leave a reply



Submit