38

これは 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>

開くと、次のように書かれています。This page contains the following errors: error on line 8 at column 1: Extra content at the end of the 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>

2 つあるのに、なぜこのように言っているのでしょうか。

4

2 に答える 2

5

ドキュメントが空の場合にも、このエラーが生成されることがわかりました。この場合も、ルート要素がないことが原因です。ただし、この状況では、「Extra content and the end of the document」というエラー メッセージが誤解を招きます。

于 2020-09-26T20:57:29.147 に答える