Igor
Igor

Reputation: 211

Valid XHTML: "itemscope" is not a member of a group specified for any attribute

I am trying to validate my document as XHTML 1.0 Transitional (W3C). I have the following error:

"itemscope" is not a member of a group specified for any attribute

Which corresponds to this code:

<body class="innerpage" itemscope itemtype="http://schema.org/Physician">

<body class="innerpage" itemscope itemtype="http://schema.org/Physician">
<!-- Facebook Conversion Code for Leads -->
<script type="text/javascript" src="js/face.js"></script>
   </body>
</html>

How can this be solved?

Thanks!

Upvotes: 4

Views: 1581

Answers (1)

Dmytro Dzyubak
Dmytro Dzyubak

Reputation: 1642

Unfortunately, it is not possible, because http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd knows nothing about those attributes (itemscope, itemtype). You can convince yourself by downloading that file to your computer and trying to find (Ctrl+F) the words itemscope or itemtype within that document. You will get 0 results.

So basically, You’ve got 2 choices starting from here:

  1. If You want to continue using itemscope and itemtype attributes You have to switch to HTML5 doctype, then your document would look like as follows:

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title>Title</title>
    </head>
    <body class="innerpage" itemscope itemtype="http://schema.org/Physician">
    <p>Content</p>
    </body>
    </html>
    

This will result in:

This document was successfully checked as HTML5!

  1. If You need to preserve XHTML Document Type Definition, then You have to switch from microdata to RDF and Your document will look the following:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.1//EN"
        "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Title</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    </head>
    <body class="innerpage" vocab="http://schema.org/" typeof="Physician">
    <p>Content</p>
    </body>
    </html>
    

This will result in:

This document was successfully checked as -//W3C//DTD XHTML+RDFa 1.1//EN!

Upvotes: 6

Related Questions