Line 62,Column 140: Element name gcse:searchBox-only cannot be represented as XML 1.0.
<gcse:searchBox-only></gcse:searchBox-only>
请帮忙避免这个错误.谢谢
解决方法
It’s not an error,it’s a warning. And it’s emitted because the
content is being served as HTML instead of with an XML MIME type,and
HTML parsers don’t know anything about namespaces — to put it in XML
terms,every element name is a local name — and so in HTML,the
literal name of that element is “g:plusone”. And that name can’t be
represented in XML because XML doesn’t allow colons in the local
names. So the spirit of the warning is to say,In case you ever want
to serve this content as XML instead of HTML,you have an element name
in it that’s not allowed in XML.
他正在谈论元素g:plusone,但这是同样的问题.
但我不同意. Colons在XML 1.0的元素本地名称中有效.它们在XML 1.0 + namespaces时才被禁止.所以警告信息肯定会得到改善.
更新:我以前提供了一个基于document.write的解决方法,但是正如Jan M在评论中指出的那样,IE有自己的想法,关于在标签名称中使用冒号的元素如何处理,所以它没有在那里工作.相反,我建议跟随Jan的答案.