The reference to entity quot;fooquot; must end with the #39;;#39; delimiter(对实体“foo的引用必须以 ; 结尾分隔符)
问题描述
我有 Google 结帐沙箱生成的 HTML 代码,可以在 HTML 页面中正常工作.当我将相同的代码放在 XHTML 页面中时,它会引发以下异常:
I have Google checkout sandbox generated HTML code which works fine in HTML page. When I put the same code in XHTML page, it throws the below exception:
对实体w"的引用必须以;"结尾分隔符
the reference to entity "w" must end with the ';' delimiter
它在下面的src
属性中引用了URL中的请求参数w
:
It's referring the request parameter w
in the URL in the below src
attribute:
<input type="image" name="Google Checkout" alt="RmFzdCBjaGVja291dCB0aHJvdWdoIEdvb2dsZQ=="
src="aHR0cDovL3NhbmRib3guZ29vZ2xlLmNvbS9jaGVja291dC9idXR0b25zL2NoZWNrb3V0LmdpZj9tZXJjaGFudF9pZD0yMTE1MTI0OTM1OTk2MjMmYW1wO3c9MTgwJmFtcDtoPTQ2JmFtcDtzdHlsZT13aGl0ZSZhbXA7dmFyaWFudD10ZXh0JmFtcDtsb2M9ZW5fVVM="
height="46" width="180" />
这是怎么引起的,我该如何解决?
How is this caused and how can I solve it?
推荐答案
与号 &
是 HTML 和 XML 中的特殊字符.如果要将其用作普通字符,则必须对其进行正确编码.用 &
代替 &
:
The ampersand &
is a special character in HTML and XML. If you want to use it as a normal character, you have to encode it correctly. Write &
instead of &
:
src="Li4uOTYyMyZhbXA7YW1wO3c9MTgwJmFtcDthbXA7aD00NiZhbXA7YW1wO3N0eWxlPXdoaXRlJmFtcDthbXA7dmFyaWFudD10ZXh0JmFtcDthbXA7bG9jPWVuX1VT"
&
表示编码实体的开始,例如 <
表示 <
,或 &
用于 &
.在您的情况下,解析器尝试将 &w
解释为实体.但是实体总是由 ;
终止,因此如果 ;
丢失,您会收到错误消息.
&
denotes the start of an encoded entity, such as <
for <
, or &
for &
. In your case the parser tries to interpret &w
as an entity. But entities are always terminated by an ;
, thus if the ;
is missing you get the error message.
这篇关于对实体“foo"的引用必须以 ';' 结尾分隔符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:对实体“foo"的引用必须以 ';' 结尾分隔


- 在不使用循环的情况下查找数字数组中的一项 2022-01-01
- 如何显示带有换行符的文本标签? 2022-01-01
- 我不能使用 json 使用 react 向我的 web api 发出 Post 请求 2022-01-01
- 使用 iframe URL 的 jQuery UI 对话框 2022-01-01
- 如何调试 CSS/Javascript 悬停问题 2022-01-01
- 如何向 ipc 渲染器发送添加回调 2022-01-01
- 为什么悬停在委托事件处理程序中不起作用? 2022-01-01
- 是否可以将标志传递给 Gulp 以使其以不同的方式 2022-01-01
- 为什么我的页面无法在 Github 上加载? 2022-01-01
- 从原点悬停时触发 translateY() 2022-01-01