How to validate XHTML page that using fb:comments ,xid and <div href>?-Collection of common programming errors

You cannot validate this against the standard (x)HTML DocTypes. If anything, this validates against XHTML2, e.g.


This should be the only xHTML flavor that allows having href attributes on any element and that was supposed to have namespace support. Unfortunately, it is also dead.

The only thing you could do is find a schema file or DTD and then validate them as XML, for instance with

  • DOMDocument::schemaValidate – Validates a document based on a schema
  • DOMDocument::schemaValidateSource – Validates a document based on a schema
  • DOMDocument::validate – Validates the document based on its DTD

The alternative would be to not to use the XFBML tags. See

  • http://wiki.developers.facebook.com/index.php/Using_HTML_to_Imitate_XFBML