views:

131

answers:

1

Hi

I've got a site coded in XHTML 1.0 Strict. I want to use the new Microdata to add breadcrumbs to my site (so Google will understand them).

My old non-microdata marked-up breadcrumbs look like this:

<ul>
  <li><a href="...">Level 1</a></li>
  <li><a href="...">Level 2</a></li>
  <li><a href="...">Level 3</a></li>
</ul>

According to Google, to markup breadcrumbs using Microdata, you extend the above code like this:

<ul>
  <li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"&gt;
    <a href="..." itemprop="url">
      <span itemprop="title">Level 1</span>
    </a>
  </li>
  ...
</ul>

But this is not valid XHTML 1.0 Strict.

What should I do?
Should I ignore the validation conflicts?
Should I write itemscope="itemscope" instead of just itemscope (this would be valid XML, but still not valid XHTML)?
Should I change the Doctype to be HTML5 instead of XHTML 1.0 Strict?

I want this to work all the way back to IE6!

Please advice :)

+2  A: 

Yes, if you wanted to use itemscope in XHTML, you would need to write itemscope="itemscope" and use XHTML5 (same DOCTYPE as HTML5, but XML syntax).

itemscope is not included in W3 HTML5, but present in WHATWG's version, so validation may continue to be a difficulty. There seems to be quite some political argument on this issue, which I haven't been following as it looks fairly tedious.

For the moment, if you want to use breadcrumb annotations in a finalised, validatable document format, you could use RDFa instead: the alternative (but older) proposal, which the argument is all about, and use the existing doctype:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"&gt;
bobince
To be clear about the state of Microdata in W3C HTML5, it's still part of the work of the HTML5 working group, but it's defined in a separate document. You can find it here: http://dev.w3.org/html5/md/ . The rationale behind this is simple enough. RDFa and Microdata inhabit the same problem space and it's unclear which will catch on with web authors, so it was felt by many members of the WG that not having either in the main spec would be most likely to give a level playing field for the two extension mechanisms to compete.
Alohci