1

I'm trying to get this (simple) webpage done for my assignment and it needs to pass through http://validator.w3.org/
It also needs to use RDFa. However no matter what I do, the RDFa vocab never gets passed by the validator.

Here's what I got:

<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML+RDFa 1.0//EN' 'http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd'>

<body vocab="http://xmlns.com/foaf/0.1/">

What am I doing wrong?

unor
  • 92,415
  • 26
  • 211
  • 360
Vojtek
  • 11
  • 3

2 Answers2

3

The vocab attribute is defined in RDFa 1.1, but with your current DOCTYPE, you are using RDFa 1.0.

Your options:

  • Keep using XHTML 1.1 and RDFa 1.0, and use the xmlns:… attribute(s) instead of the invalid vocab attribute:

    <body xmlns:foaf="http://xmlns.com/foaf/0.1/">
    

    (Then you have to use the prefix foaf:.)

  • Keep using XHTML 1.1, but switch to a DOCTYPE that supports RDFa 1.1:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.1//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd">
    
  • Switch to XHTML5, which supports RDFa 1.1 by default:

    <!DOCTYPE html>
    
Community
  • 1
  • 1
unor
  • 92,415
  • 26
  • 211
  • 360
2

Do you really have to use XHTML? I would recommend to use an HTML5 doctype. http://www.w3.org/TR/html-rdfa/ has some examples.

Also, make sure you use the NU validator from W3C: https://validator.w3.org/nu/ - the one you are using is old and should no longer be used.

scor
  • 940
  • 5
  • 5