Mobile app version of vmapp.org
Login or Join
Cody1181609

: What is the correct DTD for Schema DATA placement in XHTML pages? We get W3C validation error after placing Scheme Data in our website which was built in XHTML. Line 198, Column 41: there

@Cody1181609

Posted in: #Microdata #W3cValidation #Xhtml

We get W3C validation error after placing Scheme Data in our website which was built in XHTML.


Line 198, Column 41: there is no attribute "data-id"

<script type="IN/FollowCompany" data-id="322498" data-counter="right"></script>



(Link to the validator result)

Will changing the DTD solve this? We use,

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Cody1181609

1 Comments

Sorted by latest first Latest Oldest Best

 

@Shanna517

The data-* attributes are defined for (X)HTML5 only.

The Microdata attributes (itemscope, itemprop, …) are defined for (X)HTML5 only.

So when you switch to (X)HTML5, you can use both of these.

If you want to keep using XHTML 1.0, you could use class instead of data-* attributes, and RDFa instead of Microdata (which requires adjusting your DOCTYPE).

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme