login about faq
5
4

The following question was asked on public-rdfa mailing list:

Is it possible to use html5 doctype with rdfa being able to use xhtml style syntax and staying in strict mode?

asked Jul 05 '10 at 22:11

karlcow's gravatar image

karlcow
38129

edited Jul 06 '10 at 06:40

cygri's gravatar image

cygri ♦
8.5k412

done. I moved the answer.

(Jul 06 '10 at 03:54) karlcow karlcow's gravatar image

Thanks, much better!

(Jul 06 '10 at 06:39) cygri ♦ cygri's gravatar image

The answer is yes. I'm copying the answer I gave on public-rdfa mailing-list so it will be accessible for others in the future here.

Strict Mode

<!DOCTYPE html> 

will put your browser into strict mode.

Proposed syntax for adding RDFa

Be careful it is still a working draft at the time of this writing: RDFa in HTML

<!DOCTYPE html>
<html version="HTML+RDFa 1.1" lang="en">
  <head>
    <title>Example Document</title>
  </head>
  <body>
    <p>Moved to <a href="http://example.org/">example.org</a>.</p>
  </body>
</html>

Syntax Style (aka pseudo-xhtml)

You can write mostly with xhtml syntax style without issues. But be aware that your document will not be necessary xhtml mime-type ready. So basically, you can in html5

  • close your elements ex: <br/>
  • quote your attributes values ex: <span title="html5 is flexible">html5<span>

There is a document, HTML Polyglot, explaining the syntax if you want to serve documents using both text/html and application/xhtml+xml Be careful it is a working draft

answered Jul 06 '10 at 03:53

karlcow's gravatar image

karlcow
38129

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×64
×26
×15
×2
×1

Asked: Jul 05 '10 at 22:11

Seen: 3,473 times

Last updated: Jul 06 '10 at 06:40