Does HTML5 support namespaces?
Asked Answered
A

5

13

Are we allowed to extend HTML5 with new tags like <foo:bar> in HTML5?

I ask because the Facebook API includes just this kind of thing**, and our pages are defined as HTML5.

More specifically, is it possible to make a HTML5-conformant page that uses fb:fbml?

Alexei answered 19/10, 2011 at 16:30 Comment(0)
A
10

Strictly speaking, no. You can have JavaScript code write the FBML which gets around any potential validation issues, but it's bad form.

That aside, even if you could, you don't want to make a page that uses FBML. FBML will be deprecated on Jan 1, 2012 and after June 1, 2012 FBML will no longer work.

Source: https://developers.facebook.com/docs/reference/fbml/

Adjectival answered 19/10, 2011 at 17:10 Comment(0)
V
1

No you are not allowed to create your own tags in HTML5, this could result in conflicts and defeats the purpose of having a standard.

Per W3 you can add an xml mime type of application/xhtml+xml if you would like to serve up xhtml5. Facebook is serving up XHTML and this is why they can use custom namespaces. http://www.w3.org/TR/html5-diff/#syntax

So, yes would be valid XHTML5 but not HTML5.

More discussions on SO: Facebook Connect and HTML5, xmlns available?

Vestpocket answered 19/10, 2011 at 17:11 Comment(2)
The purpose of a namespace is to prevent conflicts so you can create your own tags.Cirri
So that explains why CSS namespace selectors don't work for me.Flashbulb
N
1

Use XHTML(5). XML allows namespaces, and XHTML(5) is an extension of XML, so therefore, it allows namespaces, while HTML(5) does not.

Northwards answered 24/6, 2014 at 22:21 Comment(0)
V
0

As Jeff Sherlock said, you don't want to use FBML anymore as it will be deprecated. Pages now use Apps, which you can have linked to a website. So now you just create a page on your website (width 520px or less), and attach the page to your app. You can just Javascript, HTML, CSS, jQuery, etc. - just about anything, including HTML5. Much easier to create tabs and all sorts of things on FB now.

Vein answered 19/10, 2011 at 19:2 Comment(0)
O
0

You can create your own elements; you do it the same way that Facebook does. Create your own doctype with a custom namespace, but you won't be outputting HTML5, you'll be outputting XHTML5. Plus, I'd follow the other gents recommendations about straying from the standards... Friends don't let friends.

Odonnell answered 19/10, 2011 at 19:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.