Re: Validation of Facebook Code

On Sun, Sep 11, 2011 at 10:20 PM, Marvin Steppat
<codekicker@googlemail.com> wrote:
> when I validated http://codekicker.de/ I noticed that the typical
> Facebook Markup
>
> <meta property="fb:page_id" content="17566831" />
> was flagged as illegal.

s/illegal/invalid/

> That was a surprise because it is mandated this way by Facebook.

Are you talking about this page?

http://developers.facebook.com/docs/insights/

Major web companies like Facebook, along with many other sources of
developer influence, regularly suggest markup patterns that are
non-conforming.

> Can somebody comment on the proposed best-practice to deal with this situation? Is there a way to reach
> full validity and be conformant with Facebook at the same time?

Not using your declared conformance target of XHTML 1.0 Strict.

It's not currently possible to serve markup as text/html that conforms
to W3C (X)HTML Recommendations and uses the pattern suggested by
Facebook.

W3C is working on a spec that would allow this markup pattern to
conform in text/html as HTML4 + RDFa, HTML5 + RDFa, or XHTML5 + RDFa:

    http://dev.w3.org/html5/rdfa/

As a working draft, this is a moving conformance target and may never
become a Recommendation. The W3C validator currently only supports
validating HTML4 + RDFa.

How you deal with this situation depends on what you're trying to get
out of validation. The following links might help you think about that
question:

http://validator.w3.org/docs/help.html#validation_basics

http://validator.w3.org/docs/why.html

http://dev.w3.org/html5/spec/Overview.html#conformance-requirements-for-authors

(My personal opinion is deviations from W3C Recommendations can be
useful, but should be deliberate not accidental. A good example of
useful non-conformance would be adding ARIA landmarks that improve
accessibility to a document that otherwise claims compatibility with
HTML 4.01. Consequently, the process of validation is more important
than the result of validity.)

Hope that helps.

--
Benjamin Hawkes-Lewis

Received on Friday, 16 September 2011 06:45:15 UTC