解析XML时出错:对实体“版本”的引用必须以';'结尾分隔符 [英] Error parsing XML : The reference to entity "version" must end with the ';' delimiter
问题描述
我对此很新,很抱歉,如果这是一个简单的问题。
I'm fairly new to this, so sorry if this is a simple question.
我正在尝试在我的网站上安装FB like box www.thehungryeurasian.com
I'm trying to install the FB like box onto my website www.thehungryeurasian.com
但是,当我尝试插入Javascript SDK时:
However, when I try inserting the Javascript SDK:
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.0";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
出现以下错误:
Error parsing XML, line 884, column 64:
The reference to entity "version" must end with the ';' delimiter.
推荐答案
看起来有些事情是将您的文档解释为XML而不是比HTML。 XML比HTML更严格 - 其中一条规则是&符号(&
)具有特殊含义。它们的意思是这里有一个XML实体,这是一个特殊的角色。例如,您可以输入& quot;
来插入或
& gt ;
将>插入到您的文档中。
It looks like something is interpreting your document as XML rather than HTML. XML is much stricter than HTML - one of the rules is that ampersands (&
) have a special meaning. They mean "here comes an XML entity", which is a special character. For instance, you can type "
to insert "
, or >
to insert > into your document.
在这种情况下,您的代码正在解释& version
在第6行作为其中一个实体的开头。如果您按如下方式更新第6行:
In this case, your code is interpreting &version
on line 6 as the start of one of these entities. If you update line 6 as follows:
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.0";
然后你会发现错误消失了。
Then you should find that error disappears.
这篇关于解析XML时出错:对实体“版本”的引用必须以';'结尾分隔符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!