2013-05-31 10 views
9

To XML:XML Błąd: Dodatkowa treść na końcu dokumentu

<?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> 

Kiedy go otworzyć to mówi: This page contains the following errors: error on line 8 at column 1: Extra content at the end of the document

Ale kiedy tam jest tylko to:

<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> 

W porządku. Dlaczego to mówi, gdy jest dwa?

+0

Możliwy duplikat [Błąd w wierszu 2 w kolumnie 1: Dodatkowa treść na końcu dokumentu] (http://stackoverflow.com/questions/4544272/error -on-line-2-at-column-1-extra-content-at-the-end-of-the-document) –

Odpowiedz

27

Trzeba węzła głównego

<?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> 
+0

oh .... dziękuję. @James – internetgho5t

+0

Nie ma za co. – James

Powiązane problemy