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:
You close the
xs:schema
tag on line2, before the rest of your XSD.You use a self-closing
xs:element
tag on line 3 where you probably wanted it to be the parent of thexs: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
Php: Locale Aware Number Format
Heredoc Interfering with Code Indentation
How to View/Open a Word Document in My Browser Using with PHP or HTML
Output Text File with Line Breaks in PHP
Do I Really Need to Do MySQL_Close()
Disable Add to Cart Button for an Array of Products Ids in Woocommerce
PHP Best Practices for User Authentication and Password Security
Laravel Eloquent Update Just If Changes Have Been Made
How to Generate Random Password with PHP
Laravel 5.2 Cors, Get Not Working with Preflight Options
PHP String Interpolation Syntax
How to Handle Diacritics (Accents) When Rewriting 'Pretty Urls'
Pdo Error: SQLstate[Hy000]: General Error: 2031