LoginSignup
4
2

More than 5 years have passed since last update.

クリエイティブ・コモンズのHTML+RDFaコードは、HTML5としてinvalid → xmlns:ccをprefixにすれば解決

Last updated at Posted at 2015-01-16

クリエイティブ・コモンズのライセンス選択ツール画面

Screen capture of http://creativecommons.org/choose/

出力されたHTML+RDFaコード

<a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="クリエイティブ・コモンズ・ライセンス" style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/88x31.png" /></a><br /><a xmlns:cc="http://creativecommons.org/ns#" href="http://ja.ishibashihideto.net/" property="cc:attributionName" rel="cc:attributionURL">石橋秀仁</a> を著作者とするこの 作品 は <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">クリエイティブ・コモンズの 表示 4.0 国際 ライセンス</a>で提供されています。

HTML5の体裁にしたもの

<!DOCTYPE html>
<html lang="ja">
  <head>
  <meta charset="utf-8">
  <title>CC HTML+RDFa</title>
</head>
  <body>

<a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="クリエイティブ・コモンズ・ライセンス" style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/88x31.png" /></a><br /><a xmlns:cc="http://creativecommons.org/ns#" href="http://ja.ishibashihideto.net/" property="cc:attributionName" rel="cc:attributionURL">石橋秀仁</a> を著作者とするこの 作品 は <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">クリエイティブ・コモンズの 表示 4.0 国際 ライセンス</a>で提供されています。

  </body>
</html>

W3C Markup Vlidation Serviceによる検査結果

screencapture-validator-w3-org-check.png

Validation Output: 1 Error

Error Line 9, Column 325: Attribute xmlns:cc not allowed here.
…tributionName" rel="cc:attributionURL">石橋秀仁</a> を著作者とするこの 作品 は <a rel="license…

Warning Line 9, Column 325: Attribute with the local name xmlns:cc is not serializable as XML 1.0.
…tributionName" rel="cc:attributionURL">石橋秀仁</a> を著作者とするこの 作品 は <a rel="license…

解決策

xmlns:cc="http://creativecommons.org/ns#"

の部分を削除すればよい。(コメントでご指摘いただきました)

4
2
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
2