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="Fast checkout through Google"
src="http://sandbox.google.com/checkout/buttons/checkout.gif?merchant_id=211512493599623&w=180&h=46&style=white&variant=text&loc=en_US"
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="...9623&w=180&h=46&style=white&variant=text&loc=en_US"
&
表示编码实体的开始,例如 <
表示 <
,或 &
用于 &
.在您的情况下,解析器尝试将 &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
- 在 JS 中获取客户端时区(不是 GMT 偏移量) 2022-01-01
- 当用户滚动离开时如何暂停 youtube 嵌入 2022-01-01
- Karma-Jasmine:如何正确监视 Modal? 2022-01-01
- 动态更新多个选择框 2022-01-01
- 角度Apollo设置WatchQuery结果为可用变量 2022-01-01
- 有没有办法使用OpenLayers更改OpenStreetMap中某些要素 2022-09-06
- 响应更改 div 大小保持纵横比 2022-01-01
- 在for循环中使用setTimeout 2022-01-01
- 悬停时滑动输入并停留几秒钟 2022-01-01