I am really interested in how FB created FBML and how to go about creating something similar. Did they write a C++ processor that replaces FBML with HTML or do they use XSLT or what did they do to create a templating language like that? I am wanting to do this mainly for my own knowledge and fun on my spare time to see if i am able to build something similar. Ive tried looking up how they made it but all I get is ways to use FBML.
Share
Well, there are 3 ways to write a parser for XML that converts to HTML:
Option #1 is bascially not done since you can always use #2 instead.
Judging from the the fact that some of the tags need to talk to resources outside of the XML file (e.g.
fb:if-can-see), #2 and #4 seem more likely than #3 — both would have easier access to SQL databases or NoSQL databases and the like.(The XSLT libraries in many languages allow one to define custom functions that can access arbitrary data sources in the language they are implemented, so #3 isn’t impossible).