HTML5 validator failing on Facebook OpenGraph XML Namespace xmlns:og

血红的双手。 提交于 2019-11-30 04:43:45

fb's documentation isn't wrong, but their approach to open web is. those are fb proprietary attribute values, so they're not going to ever validate, unless w3c makes them standards. that may sound gloomy, but as long as those are your only validation errors, don't worry about it. validation is an awesome tool, but remember, it's just a tool.

So I have run across a version of this same error, 3 years later it seems. Trying to validate my site using HTML5 and although it is experimental, everything validates except these xmlns attributes.

for example..

Error Line 2, Column 105: Attribute xmlns:fb not allowed here. …b="http://ogp.me/ns/fb#" xmlns:addthis="http://www.addthis.com/help/api-spec" >
Warning Line 2, Column 105: Attribute with the local name xmlns:fb is not serializable as XML 1.0. …b="http://ogp.me/ns/fb#" xmlns:addthis="http://www.addthis.com/help/api-spec" >
Error Line 2, Column 105: Attribute xmlns:addthis not allowed here. …b="http://ogp.me/ns/fb#" xmlns:addthis="http://www.addthis.com/help/api-spec" >
Warning Line 2, Column 105: Attribute with the local name xmlns:addthis is not serializable as XML 1.0. …b="http://ogp.me/ns/fb#" xmlns:addthis="http://www.addthis.com/help/api-spec" >

Line 2 of my code is as follows:

2.<html lang="en-US" xmlns:fb="http://ogp.me/ns/fb#" xmlns:addthis="http://www.addthis.com/help/api-spec" >

having researched this error, which mirrors your error, it seems that even 3 years later, there is no viable fix for this. However, it seems that plugins that are following this technique are doing so when there is correct HTML5 code available. So make sure you select the correct code if doing the addin on your site such as the following link for facebook:

HTML5 Facebook Info

That should take care of your errors at the least, for those of us trying to use a plugin to handle multiple likes, shares, and plus ones, it might be best to just do each instance by itself.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!