xmlfbmlgoogle-plus-onexfbml

why markup languages like facebook FBML or google g exists?


I thought long and hard and can't think of problems that cannot be solved by html, css, javascript and iframes.

Can somebody shed some light on reasoning's behind FBML and google g markup languages existance. How and what do they make easier?

g: plusone example (code used when adding like button for example):

<!-- Place this tag where you want the +1 button to render -->
<g:plusone size="tall"></g:plusone>

or facebook fbml example - ( code used when adding facebook like button for example):

<fb:like send="false" layout="box_count" width="450" show_faces="true" action="recommend" font="verdana"></fb:like>

<html xmlns:fb="https://www.facebook.com/2008/fbml">

Looking on example above - can't we simply replace

<g and <fb 

elements with divs that have facebook or plusone class for example?

P.S. not sure if g is a language - at least I couln't find anything about it while googling. Really sucks when they use these single character names like g or c.


Solution

  • It's probably to avoid namespacing issues.

    If you implement this with a DIV you have to make 100% sure that the classname you choose is unique, so that it doesn't conflict with the user's classes. For example <div class="google-plusone" would not be a good name because what if the user wrapped this code into his own container and named it "google-plusone" too (not unlikely)?

    So Google would have to come up with ugly class names like "google----plusone", etc. It's much more elegant to specify a new XML namespace and put their code inside.