Is Facebook Markup Language (FBML) HTML, XML or some homemade demon spawn of the two?

By Rick Jelliffe
March 25, 2009 | Comments: 5

I was browsing at the local Kinokuniya bookstore yesterday, and I flipped through the O'Reilly book on FBML. Now I have no particular interest in FBML, but I was interested in that book steered clear of any issues relating to syntax. No mention of XML in the index, or in the introduction, yet it clearly used namespace prefixes and empty element syntax, so it looked like XML.

I wondered to myself if this represented some new stage of XML's ubiquity, where XML is such a given it does not even need to be stated, let alone explained. But looking through the FBML website has left me uncertain.

The FBML material never seems to say that it is XML: but it frequently talks of HTML: FBML is an evolved subset of HTML. Now there are things that definitely are spoken of as XML: for example it has a "DTD" (actually an XML Schema.) And there is something called XFBRL intended to be put in XHTML.

There are hints such as:

If you're formatting the tag as FBML, 
you don't need to use a closing tag.
<fb:name uid="12345" />

If you're formatting the tag as XFBML for Facebook Connect,
you must use a closing tag.
<fb:name uid="12345"></fb:name>

As near as I can work out, FBML is designed to look like XML but not necessarily be well-formed. But I really don't know, because the documentation is interested in element and attribute names, not syntax. From that, I would guess either that there is some hedging of bets going on about formats, or that there is a single editor application that is being documented, which looks after the syntax.

Does any reader have any pointers to better information?

(By the way, I am quite sympathetic to the idea that XML's Draconian WF handling is excessive for user-oriented web documents, which the title of this piece may not make entirely clear.)

You might also be interested in:


This won't validate in an xml parser:

<fb:18-plus>Oooh la laBarney?</fb:18-plus>

So it is a demon spawn.

Because a name cannot start with a digit!

Homemade demon spawn from a PHP shop.

libfbml actually uses libraries from firefox to render the "approved" subset of HTML with FBML enhancemens into a safe DOM structure, which is then serialized back into HTML for output to clients.

Gonna fight well-formedness? HA!

Good idea in one respect: If XML is so strict the user has to know it all to use it, it's only going to be used well by strict users. Any guesses how many people out there know the rules of XML that well? I don't. :-(

It's not that tough to deal with XML, len. Just use a validating parser to catch problems. There are free ones all over the internet.

News Topics

Recommended for You

Got a Question?